1 | <?php |
||
16 | class EmailDataFactory |
||
17 | { |
||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $config; |
||
22 | |||
23 | /** |
||
24 | * @var \eZ\Publish\Core\Helper\TranslationHelper |
||
25 | */ |
||
26 | protected $translationHelper; |
||
27 | |||
28 | /** |
||
29 | * @var \eZ\Publish\Core\Helper\FieldHelper |
||
30 | */ |
||
31 | protected $fieldHelper; |
||
32 | |||
33 | /** |
||
34 | * @var \eZ\Publish\API\Repository\ContentService |
||
35 | */ |
||
36 | protected $contentService; |
||
37 | |||
38 | /** |
||
39 | * @var \Twig_Environment |
||
40 | */ |
||
41 | protected $twig; |
||
42 | |||
43 | /** |
||
44 | * EmailDataFactory constructor. |
||
45 | * |
||
46 | * @param array $config |
||
47 | * @param \eZ\Publish\Core\Helper\TranslationHelper $translationHelper |
||
48 | * @param \eZ\Publish\Core\Helper\FieldHelper $fieldHelper |
||
49 | * @param \eZ\Publish\API\Repository\ContentService $contentService |
||
50 | * @param \Twig_Environment $twig |
||
51 | */ |
||
52 | public function __construct( |
||
65 | |||
66 | /** |
||
67 | * Factory method. |
||
68 | * |
||
69 | * @param InformationCollected $value |
||
70 | * |
||
71 | * @return EmailData |
||
72 | */ |
||
73 | public function build(InformationCollected $value) |
||
99 | |||
100 | /** |
||
101 | * Returns resolved parameter. |
||
102 | * |
||
103 | * @param TemplateData $data |
||
104 | * @param string $field |
||
105 | * @param string $property |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | protected function resolve(TemplateData $data, $field, $property = Constants::FIELD_TYPE_TEXT) |
||
135 | |||
136 | /** |
||
137 | * Returns resolved template name. |
||
138 | * |
||
139 | * @param string $contentTypeIdentifier |
||
140 | * |
||
141 | * @return string |
||
142 | */ |
||
143 | protected function resolveTemplate($contentTypeIdentifier) |
||
154 | |||
155 | /** |
||
156 | * Renders email template. |
||
157 | * |
||
158 | * @param TemplateData $data |
||
159 | * |
||
160 | * @throws MissingEmailBlockException |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | protected function resolveBody(TemplateData $data) |
||
185 | } |
||
186 |