<commit_before><commit_msg>III-217: Add PDF export command<commit_after><?php

namespace CultuurNet\UDB3\EventExport\Command;

use CultuurNet\UDB3\EventExport\EventExportQuery;
use ValueObjects\Web\EmailAddress;

class ExportEventsAsPDF extends ExportEvents
{
    /**
     * @var string
     */
    private $brand;

    /**
     * @var string
     */
    private $title;

    /**
     * @var string
     */
    private $subtitle;

    /**
     * @var string
     */
    private $footer;

    /**
     * @var string
     */
    private $publisher;

    /**
     * @param EventExportQuery $query
     * @param EmailAddress|null $address
     * @param string[] $selection
     * @param string[] $include
     * @param string[] $customizations
     */
    public function __construct(
      EventExportQuery $query,
      EmailAddress $address = null,
      $selection = null,
      $include = null,
      $customizations = []
    ) {
        parent::__construct($query, $address, $selection, $include);

        $this->setCustomizations($customizations);
    }

    /**
     * @param string[] $customizations
     */
    private function setCustomizations($customizations)
    {
        $propertyNames = [
          'brand',
          'title',
          'subtitle',
          'footer',
          'publisher'
        ];
        foreach ($propertyNames as $propertyName) {
            if (isset($customizations[$propertyName])) {
                $this[$propertyName] = $customizations[$propertyName];
            } else {
                $this[$propertyName] = '';
            }
        }
    }

    /**
     * @return string
     */
    public function getBrand()
    {
        return $this->brand;
    }

    /**
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * @return string
     */
    public function getSubtitle()
    {
        return $this->subtitle;
    }

    /**
     * @return string
     */
    public function getFooter()
    {
        return $this->footer;
    }

    /**
     * @return string
     */
    public function getPublisher()
    {
        return $this->publisher;
    }
}
{'fraction_non_alphanumeric': 0.12858464384828863, 'fraction_numerical': 0.002312673450508788, 'mean_word_length': 1.7695262483994878, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4323708', 'n_tokens_mistral': 635, 'n_tokens_neox': 614, 'n_words': 125}