File "Transformer.php"

Full Path: /home/warrior1/public_html/wp-content/plugins/mailpoet/lib/Newsletter/Editor/Transformer.php
File size: 531 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace MailPoet\Newsletter\Editor;

if (!defined('ABSPATH')) exit;


class Transformer {

  private $transformer;

  public function __construct(
    $args
  ) {
    $titleListOnly = $args['displayType'] === 'titleOnly' && $args['titleFormat'] === 'ul';

    if ($titleListOnly) $transformer = new TitleListTransformer($args);
    else $transformer = new PostListTransformer($args);
    $this->transformer = $transformer;
  }

  public function transform($posts) {
    return $this->transformer->transform($posts);
  }
}