06-table_names_generator.php 538 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace cx_newsletter;
  3. abstract class table_names_generator {
  4. public function __construct(\wpdb $database) {
  5. $this->database = $database;
  6. }
  7. protected function add_prefixes(string $name) : string {
  8. return $this->get_wordpress_prefix().$this->get_own_prefix().$name;
  9. }
  10. protected function get_own_prefix() : string {
  11. return 'cx_newsletter_';
  12. }
  13. protected function get_wordpress_prefix() : string {
  14. return $this->database->prefix;
  15. }
  16. private \wpdb $database;
  17. }