1 | <?php |
||
10 | class Notification |
||
11 | { |
||
12 | /** |
||
13 | * @var null|NotificationId |
||
14 | */ |
||
15 | protected $notificationId; |
||
16 | |||
17 | /** |
||
18 | * @var Destination |
||
19 | */ |
||
20 | protected $destination; |
||
21 | |||
22 | /** |
||
23 | * @var Subject |
||
24 | */ |
||
25 | protected $subject; |
||
26 | |||
27 | /** |
||
28 | * @var Body |
||
29 | */ |
||
30 | protected $body; |
||
31 | |||
32 | /** |
||
33 | * @var null|DeduplicationKey |
||
34 | */ |
||
35 | protected $deduplicationKey; |
||
36 | |||
37 | /** |
||
38 | * @var null|string |
||
39 | */ |
||
40 | protected $templateName; |
||
41 | |||
42 | /** |
||
43 | * @var array|null |
||
44 | */ |
||
45 | protected $templateVariables; |
||
46 | |||
47 | /** |
||
48 | * @var DateTimeImmutable |
||
49 | */ |
||
50 | protected $createdAt; |
||
51 | |||
52 | /** |
||
53 | * @var null|DateTimeImmutable |
||
54 | */ |
||
55 | protected $sentAt; |
||
56 | |||
57 | /** |
||
58 | * @var null|DateTimeImmutable |
||
59 | */ |
||
60 | protected $failedAt; |
||
61 | |||
62 | /** |
||
63 | * @var null|string |
||
64 | 8 | */ |
|
65 | protected $failedFor; |
||
66 | |||
67 | /** |
||
68 | * @param Destination $destination |
||
69 | * @param Subject $subject |
||
70 | * @param Body $body |
||
71 | * @param DeduplicationKey|null $deduplicationKey |
||
72 | 8 | * @param string|null $templateName |
|
73 | 8 | * @param array|null $templateVariables |
|
74 | 8 | */ |
|
75 | 8 | public function __construct( |
|
94 | |||
95 | 4 | /** |
|
96 | * @return null|NotificationId |
||
97 | */ |
||
98 | public function notificationId(): ?NotificationId |
||
102 | |||
103 | 3 | /** |
|
104 | * @return Destination |
||
105 | */ |
||
106 | public function destination(): Destination |
||
110 | |||
111 | 3 | /** |
|
112 | * @return Subject |
||
113 | */ |
||
114 | public function subject(): Subject |
||
118 | |||
119 | 4 | /** |
|
120 | * @return Body |
||
121 | */ |
||
122 | public function body(): Body |
||
126 | |||
127 | 1 | /** |
|
128 | * @return null|DeduplicationKey |
||
129 | */ |
||
130 | public function deduplicationKey(): ?DeduplicationKey |
||
134 | |||
135 | 2 | /** |
|
136 | * @return DateTimeImmutable |
||
137 | */ |
||
138 | public function createdAt(): DateTimeImmutable |
||
142 | |||
143 | 2 | /** |
|
144 | * @return DateTimeImmutable|null |
||
145 | */ |
||
146 | public function sentAt(): ?DateTimeImmutable |
||
150 | |||
151 | 2 | /** |
|
152 | * @return bool |
||
153 | */ |
||
154 | 2 | public function isSent(): bool |
|
158 | |||
159 | /** |
||
160 | * @return void |
||
161 | */ |
||
162 | public function markSent(): void |
||
168 | |||
169 | /** |
||
170 | * @return DateTimeImmutable|null |
||
171 | */ |
||
172 | public function failedAt(): ?DateTimeImmutable |
||
176 | |||
177 | /** |
||
178 | * @return null|string |
||
179 | */ |
||
180 | public function failedFor(): ?string |
||
184 | |||
185 | /** |
||
186 | * @return bool |
||
187 | */ |
||
188 | public function isFailed(): bool |
||
192 | |||
193 | /** |
||
194 | * @return void |
||
195 | */ |
||
196 | public function markFailed(string $reason): void |
||
202 | |||
203 | /** |
||
204 | * @return void |
||
205 | */ |
||
206 | public function unmarkFailed(): void |
||
211 | |||
212 | /** |
||
213 | * @return bool |
||
214 | */ |
||
215 | public function isFresh(): bool |
||
219 | |||
220 | /** |
||
221 | * @return void |
||
222 | */ |
||
223 | private function assertNotSent(): void |
||
235 | } |
||
236 | |||
237 |