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 | public function __construct( |
||
66 | |||
67 | /** |
||
68 | * Create new notification with body only |
||
69 | * |
||
70 | * @param string $body |
||
71 | * |
||
72 | * @return Notification |
||
73 | */ |
||
74 | public static function createWithBody(string $body): Notification |
||
78 | |||
79 | /** |
||
80 | * Set payload |
||
81 | * |
||
82 | * @param Payload $payload |
||
83 | * |
||
84 | * @return Notification |
||
85 | */ |
||
86 | public function withPayload(Payload $payload): Notification |
||
94 | |||
95 | /** |
||
96 | * Get payload |
||
97 | * |
||
98 | * @return Payload |
||
99 | */ |
||
100 | public function getPayload(): Payload |
||
104 | |||
105 | /** |
||
106 | * Set apn identifier |
||
107 | * |
||
108 | * @param ApnId $apnId |
||
109 | * |
||
110 | * @return Notification |
||
111 | */ |
||
112 | public function withApnId(ApnId $apnId = null): Notification |
||
120 | |||
121 | /** |
||
122 | * Get identifier of notification |
||
123 | * |
||
124 | * @return ApnId |
||
125 | */ |
||
126 | public function getApnId(): ?ApnId |
||
130 | |||
131 | /** |
||
132 | * Set priority |
||
133 | * |
||
134 | * @param Priority $priority |
||
135 | * |
||
136 | * @return Notification |
||
137 | */ |
||
138 | public function withPriority(Priority $priority = null): Notification |
||
146 | |||
147 | /** |
||
148 | * Get priority |
||
149 | * |
||
150 | * @return Priority |
||
151 | */ |
||
152 | public function getPriority(): ?Priority |
||
156 | |||
157 | /** |
||
158 | * Set expiration |
||
159 | * |
||
160 | * @param Expiration $expiration |
||
161 | * |
||
162 | * @return Notification |
||
163 | */ |
||
164 | public function withExpiration(Expiration $expiration = null): Notification |
||
172 | |||
173 | /** |
||
174 | * Get expiration |
||
175 | * |
||
176 | * @return Expiration |
||
177 | */ |
||
178 | public function getExpiration(): ?Expiration |
||
182 | |||
183 | /** |
||
184 | * Set the collapse identifier |
||
185 | * |
||
186 | * @param CollapseId|null $collapseId |
||
187 | * |
||
188 | * @return Notification |
||
189 | */ |
||
190 | public function withCollapseId(CollapseId $collapseId = null): Notification |
||
198 | |||
199 | /** |
||
200 | * Get the collapse identifier |
||
201 | * |
||
202 | * @return CollapseId|null |
||
203 | */ |
||
204 | public function getCollapseId(): ?CollapseId |
||
208 | |||
209 | public function withPushType(PushType $pushType): Notification |
||
217 | |||
218 | public function getPushType(): ?PushType |
||
222 | } |
||
223 |