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 | * Constructor. |
||
48 | * |
||
49 | * @param Payload $payload |
||
50 | * @param ApnId|null $apnId |
||
51 | * @param Priority|null $priority |
||
52 | * @param Expiration|null $expiration |
||
53 | * @param CollapseId|null $collapseId |
||
54 | */ |
||
55 | public function __construct( |
||
68 | |||
69 | /** |
||
70 | * Create new notification with body only |
||
71 | * |
||
72 | * @param string $body |
||
73 | * |
||
74 | * @return Notification |
||
75 | */ |
||
76 | public static function createWithBody(string $body): Notification |
||
80 | |||
81 | /** |
||
82 | * Set payload |
||
83 | * |
||
84 | * @param Payload $payload |
||
85 | * |
||
86 | * @return Notification |
||
87 | */ |
||
88 | public function withPayload(Payload $payload): Notification |
||
96 | |||
97 | /** |
||
98 | * Get payload |
||
99 | * |
||
100 | * @return Payload |
||
101 | */ |
||
102 | public function getPayload(): Payload |
||
106 | |||
107 | /** |
||
108 | * Set apn identifier |
||
109 | * |
||
110 | * @param ApnId $apnId |
||
111 | * |
||
112 | * @return Notification |
||
113 | */ |
||
114 | public function withApnId(ApnId $apnId = null): Notification |
||
122 | |||
123 | /** |
||
124 | * Get identifier of notification |
||
125 | * |
||
126 | * @return ApnId |
||
127 | */ |
||
128 | public function getApnId(): ?ApnId |
||
132 | |||
133 | /** |
||
134 | * Set priority |
||
135 | * |
||
136 | * @param Priority $priority |
||
137 | * |
||
138 | * @return Notification |
||
139 | */ |
||
140 | public function withPriority(Priority $priority = null): Notification |
||
148 | |||
149 | /** |
||
150 | * Get priority |
||
151 | * |
||
152 | * @return Priority |
||
153 | */ |
||
154 | public function getPriority(): ?Priority |
||
158 | |||
159 | /** |
||
160 | * Set expiration |
||
161 | * |
||
162 | * @param Expiration $expiration |
||
163 | * |
||
164 | * @return Notification |
||
165 | */ |
||
166 | public function withExpiration(Expiration $expiration = null): Notification |
||
174 | |||
175 | /** |
||
176 | * Get expiration |
||
177 | * |
||
178 | * @return Expiration |
||
179 | */ |
||
180 | public function getExpiration(): ?Expiration |
||
184 | |||
185 | /** |
||
186 | * Set the collapse identifier |
||
187 | * |
||
188 | * @param CollapseId|null $collapseId |
||
189 | * |
||
190 | * @return Notification |
||
191 | */ |
||
192 | public function withCollapseId(CollapseId $collapseId = null): Notification |
||
200 | |||
201 | /** |
||
202 | * Get the collapse identifier |
||
203 | * |
||
204 | * @return CollapseId|null |
||
205 | */ |
||
206 | public function getCollapseId(): ?CollapseId |
||
210 | } |
||
211 |