16-plugin_worker.php 975 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace cx_newsletter;
  3. use \wpdb;
  4. abstract class plugin_worker
  5. implements plugin_worker_interface {
  6. public function __construct(
  7. settings $settings,
  8. database_versions_manager $versions,
  9. table_names_generator $tables,
  10. wpdb $database
  11. ) {
  12. $this->settings = $settings;
  13. $this->tables = $tables;
  14. $this->database = $database;
  15. $this->versions = $versions;
  16. }
  17. protected function get_settings() : settings {
  18. return $this->settings;
  19. }
  20. protected function get_tables() : table_names_generator {
  21. return $this->tables;
  22. }
  23. protected function get_database() : wpdb {
  24. return $this->database;
  25. }
  26. protected function get_versions() : database_versions_manager {
  27. return $this->versions;
  28. }
  29. private database_versions_manager $versions;
  30. private settings $settings;
  31. private wpdb $database;
  32. private table_names_generator $tables;
  33. }