1 | <?php |
||
15 | final class Message extends Swift_Message implements ExtendedMessage |
||
16 | { |
||
17 | use OptionsSanitizingCapabilities; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $campaignId; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | private $perRecipientTags; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | private $metadata; |
||
33 | |||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | private $perRecipientMetadata; |
||
38 | |||
39 | /** |
||
40 | * @var array |
||
41 | */ |
||
42 | private $substitutionData; |
||
43 | |||
44 | /** |
||
45 | * @var array |
||
46 | */ |
||
47 | private $perRecipientSubstitutionData; |
||
48 | |||
49 | /** |
||
50 | * @var array |
||
51 | */ |
||
52 | private $options; |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 21 | public static function newInstance($subject = null, $body = null, $contentType = null, $charset = null) |
|
58 | { |
||
59 | 21 | return new self($subject, $body, $contentType, $charset); |
|
60 | } |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 60 | public function __construct($subject = null, $body = null, $contentType = null, $charset = null) |
|
66 | { |
||
67 | 60 | parent::__construct($subject, $body, $contentType, $charset); |
|
68 | |||
69 | 60 | $this->campaignId = ''; |
|
70 | 60 | $this->perRecipientTags = []; |
|
71 | 60 | $this->metadata = []; |
|
72 | 60 | $this->perRecipientMetadata = []; |
|
73 | 60 | $this->substitutionData = []; |
|
74 | 60 | $this->perRecipientSubstitutionData = []; |
|
75 | 60 | $this->options = []; |
|
76 | 60 | } |
|
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | 21 | public function getCampaignId() |
|
82 | { |
||
83 | 21 | return $this->campaignId; |
|
84 | } |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | 6 | public function setCampaignId($campaignId) |
|
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | 21 | public function getPerRecipientTags() |
|
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | 12 | public function setPerRecipientTags($recipient, array $tags) |
|
113 | |||
114 | /** |
||
115 | * {@inheritdoc} |
||
116 | */ |
||
117 | 21 | public function getMetadata() |
|
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | 12 | public function setMetadata(array $metadata) |
|
131 | |||
132 | /** |
||
133 | * {@inheritdoc} |
||
134 | */ |
||
135 | 21 | public function getPerRecipientMetadata() |
|
139 | |||
140 | /** |
||
141 | * {@inheritdoc} |
||
142 | */ |
||
143 | 18 | public function setPerRecipientMetadata($recipient, array $metadata) |
|
149 | |||
150 | /** |
||
151 | * {@inheritdoc} |
||
152 | */ |
||
153 | 21 | public function getSubstitutionData() |
|
157 | |||
158 | /** |
||
159 | * {@inheritdoc} |
||
160 | */ |
||
161 | 6 | public function setSubstitutionData(array $substitutionData) |
|
167 | |||
168 | /** |
||
169 | * {@inheritdoc} |
||
170 | */ |
||
171 | 21 | public function getPerRecipientSubstitutionData() |
|
175 | |||
176 | /** |
||
177 | * {@inheritdoc} |
||
178 | */ |
||
179 | 12 | public function setPerRecipientSubstitutionData($recipient, array $substitutionData) |
|
185 | |||
186 | /** |
||
187 | * {@inheritdoc} |
||
188 | */ |
||
189 | 24 | public function getOptions() |
|
193 | |||
194 | /** |
||
195 | * {@inheritdoc} |
||
196 | */ |
||
197 | 15 | public function setOptions(array $options) |
|
206 | |||
207 | /** |
||
208 | * @param array $tags |
||
209 | * |
||
210 | * @return array |
||
211 | */ |
||
212 | 12 | private function sanitizeTags(array $tags) |
|
222 | |||
223 | /** |
||
224 | * @param array $metadata |
||
225 | * |
||
226 | * @return array |
||
227 | */ |
||
228 | 24 | private function sanitizeMetadata(array $metadata) |
|
241 | |||
242 | /** |
||
243 | * @param array $substitutionData |
||
244 | * |
||
245 | * @return array |
||
246 | */ |
||
247 | 12 | private function sanitizeSubstitutionData(array $substitutionData) |
|
257 | } |
||
258 |