LayoutHelper.php
3 years ago
MetaInformationManager.php
2 months ago
PostContentManager.php
10 months ago
PostListTransformer.php
3 years ago
PostTransformer.php
1 year ago
PostTransformerContentsExtractor.php
2 months ago
StructureTransformer.php
3 years ago
TitleListTransformer.php
1 year ago
Transformer.php
3 years ago
index.php
3 years ago
Transformer.php
26 lines
| 1 | <?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing |
| 2 | |
| 3 | namespace MailPoet\Newsletter\Editor; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | class Transformer { |
| 9 | |
| 10 | private $transformer; |
| 11 | |
| 12 | public function __construct( |
| 13 | $args |
| 14 | ) { |
| 15 | $titleListOnly = $args['displayType'] === 'titleOnly' && $args['titleFormat'] === 'ul'; |
| 16 | |
| 17 | if ($titleListOnly) $transformer = new TitleListTransformer($args); |
| 18 | else $transformer = new PostListTransformer($args); |
| 19 | $this->transformer = $transformer; |
| 20 | } |
| 21 | |
| 22 | public function transform($posts) { |
| 23 | return $this->transformer->transform($posts); |
| 24 | } |
| 25 | } |
| 26 |