15-rest_endpoint.php 713 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace cx_newsletter;
  3. use \wpdb;
  4. abstract class rest_endpoint
  5. implements rest_endpoint_interface {
  6. public function __construct(
  7. wpdb $database,
  8. settings $settings,
  9. table_names $tables
  10. ) {
  11. $this->database = $database;
  12. $this->settings = $settings;
  13. $this->tables = $tables;
  14. }
  15. protected function get_database() : wpdb {
  16. return $this->database;
  17. }
  18. protected function get_settings() : settings {
  19. return $this->settings;
  20. }
  21. protected function get_tables() : table_names {
  22. return $this->tables;
  23. }
  24. private wpdb $database;
  25. private settings $settings;
  26. private table_names $tables;
  27. }