mailpoet
/
vendor
/
woocommerce
/
email-editor
/
src
/
Engine
/
Patterns
/
class-abstract-pattern.php
class-abstract-pattern.php
41 lines
| 1 | <?php |
| 2 | declare(strict_types = 1); |
| 3 | namespace Automattic\WooCommerce\EmailEditor\Engine\Patterns; |
| 4 | if (!defined('ABSPATH')) exit; |
| 5 | abstract class Abstract_Pattern { |
| 6 | protected $name = ''; |
| 7 | protected $namespace = ''; |
| 8 | protected $block_types = array(); |
| 9 | protected $template_types = array(); |
| 10 | protected $post_types = array(); |
| 11 | protected $inserter = true; |
| 12 | protected $source = 'plugin'; |
| 13 | protected $categories = array(); |
| 14 | protected $viewport_width = 620; |
| 15 | public function get_name(): string { |
| 16 | return $this->name; |
| 17 | } |
| 18 | public function get_namespace(): string { |
| 19 | return $this->namespace; |
| 20 | } |
| 21 | public function get_properties(): array { |
| 22 | return array( |
| 23 | 'title' => $this->get_title(), |
| 24 | 'content' => $this->get_content(), |
| 25 | 'description' => $this->get_description(), |
| 26 | 'categories' => $this->categories, |
| 27 | 'inserter' => $this->inserter, |
| 28 | 'blockTypes' => $this->block_types, |
| 29 | 'templateTypes' => $this->template_types, |
| 30 | 'postTypes' => $this->post_types, |
| 31 | 'source' => $this->source, |
| 32 | 'viewportWidth' => $this->viewport_width, |
| 33 | ); |
| 34 | } |
| 35 | abstract protected function get_content(): string; |
| 36 | abstract protected function get_title(): string; |
| 37 | protected function get_description(): string { |
| 38 | return ''; |
| 39 | } |
| 40 | } |
| 41 |