1 | <?php |
||
19 | class Notification |
||
20 | { |
||
21 | /** |
||
22 | * @var Payload |
||
23 | */ |
||
24 | private $payload; |
||
25 | |||
26 | /** |
||
27 | * @var ApnId |
||
28 | */ |
||
29 | private $apnId; |
||
30 | |||
31 | /** |
||
32 | * @var Priority |
||
33 | */ |
||
34 | private $priority; |
||
35 | |||
36 | /** |
||
37 | * @var Expiration |
||
38 | */ |
||
39 | private $expiration; |
||
40 | |||
41 | /** |
||
42 | * @var CollapseId |
||
43 | */ |
||
44 | private $collapseId; |
||
45 | |||
46 | /** |
||
47 | * @var PushType |
||
48 | */ |
||
49 | private $pushType; |
||
50 | |||
51 | /** |
||
52 | * Constructor. |
||
53 | * |
||
54 | * @param Payload $payload |
||
55 | * @param ApnId|null $apnId |
||
56 | * @param Priority|null $priority |
||
57 | * @param Expiration|null $expiration |
||
58 | * @param CollapseId|null $collapseId |
||
59 | * @param PushType|null $pushType |
||
60 | */ |
||
61 | public function __construct(Payload $payload, ?ApnId $apnId = null, ?Priority $priority = null, ?Expiration $expiration = null, ?CollapseId $collapseId = null, ?PushType $pushType = null) |
||
70 | |||
71 | /** |
||
72 | * Create new notification with body only |
||
73 | * |
||
74 | * @param string $body |
||
75 | * |
||
76 | * @return Notification |
||
77 | */ |
||
78 | public static function createWithBody(string $body): Notification |
||
82 | |||
83 | /** |
||
84 | * Set payload |
||
85 | * |
||
86 | * @param Payload $payload |
||
87 | * |
||
88 | * @return Notification |
||
89 | */ |
||
90 | public function withPayload(Payload $payload): Notification |
||
98 | |||
99 | /** |
||
100 | * Get payload |
||
101 | * |
||
102 | * @return Payload |
||
103 | */ |
||
104 | public function getPayload(): Payload |
||
108 | |||
109 | /** |
||
110 | * Set apn identifier |
||
111 | * |
||
112 | * @param ApnId $apnId |
||
113 | * |
||
114 | * @return Notification |
||
115 | */ |
||
116 | public function withApnId(ApnId $apnId = null): Notification |
||
124 | |||
125 | /** |
||
126 | * Get identifier of notification |
||
127 | * |
||
128 | * @return ApnId |
||
129 | */ |
||
130 | public function getApnId(): ?ApnId |
||
134 | |||
135 | /** |
||
136 | * Set priority |
||
137 | * |
||
138 | * @param Priority $priority |
||
139 | * |
||
140 | * @return Notification |
||
141 | */ |
||
142 | public function withPriority(Priority $priority = null): Notification |
||
150 | |||
151 | /** |
||
152 | * Get priority |
||
153 | * |
||
154 | * @return Priority |
||
155 | */ |
||
156 | public function getPriority(): ?Priority |
||
160 | |||
161 | /** |
||
162 | * Set expiration |
||
163 | * |
||
164 | * @param Expiration $expiration |
||
165 | * |
||
166 | * @return Notification |
||
167 | */ |
||
168 | public function withExpiration(Expiration $expiration = null): Notification |
||
176 | |||
177 | /** |
||
178 | * Get expiration |
||
179 | * |
||
180 | * @return Expiration |
||
181 | */ |
||
182 | public function getExpiration(): ?Expiration |
||
186 | |||
187 | /** |
||
188 | * Set the collapse identifier |
||
189 | * |
||
190 | * @param CollapseId|null $collapseId |
||
191 | * |
||
192 | * @return Notification |
||
193 | */ |
||
194 | public function withCollapseId(CollapseId $collapseId = null): Notification |
||
202 | |||
203 | /** |
||
204 | * Get the collapse identifier |
||
205 | * |
||
206 | * @return CollapseId|null |
||
207 | */ |
||
208 | public function getCollapseId(): ?CollapseId |
||
212 | |||
213 | /** |
||
214 | * Set the push type |
||
215 | * |
||
216 | * @param PushType|null $pushType |
||
217 | * |
||
218 | * @return Notification |
||
219 | */ |
||
220 | public function withPushType(?PushType $pushType): Notification |
||
228 | |||
229 | /** |
||
230 | * Get the push type |
||
231 | * |
||
232 | * @return PushType|null |
||
233 | */ |
||
234 | public function getPushType(): ?PushType |
||
238 | } |
||
239 |