1 | <?php |
||
21 | class Message extends ServiceMessage |
||
22 | { |
||
23 | const DEFAULT_TTL = 2419200; // 4 weeks |
||
24 | |||
25 | /** |
||
26 | * Notification data payload. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $notificationPayload = []; |
||
31 | |||
32 | /** |
||
33 | * Get notification payload data. |
||
34 | * |
||
35 | * @return array |
||
36 | */ |
||
37 | public function getNotificationPayload() |
||
41 | |||
42 | /** |
||
43 | * Set notification payload data. |
||
44 | * |
||
45 | * @param array $payload |
||
46 | * |
||
47 | * @throws \ZendService\Google\Exception\InvalidArgumentException |
||
48 | * @throws \ZendService\Google\Exception\RuntimeException |
||
49 | * |
||
50 | * @return $this |
||
51 | */ |
||
52 | public function setNotificationPayload(array $payload) |
||
62 | |||
63 | /** |
||
64 | * Add notification payload data. |
||
65 | * |
||
66 | * @param string $key |
||
67 | * @param mixed $value |
||
68 | * |
||
69 | * @throws \ZendService\Google\Exception\InvalidArgumentException |
||
70 | * @throws \ZendService\Google\Exception\RuntimeException |
||
71 | * |
||
72 | * @return $this |
||
73 | */ |
||
74 | public function addNotificationPayload($key, $value) |
||
90 | |||
91 | /** |
||
92 | * Clear notification payload data. |
||
93 | */ |
||
94 | public function clearNotificationPayload() |
||
100 | |||
101 | /** |
||
102 | * {@inheritdoc} |
||
103 | */ |
||
104 | public function toJson() |
||
136 | |||
137 | /** |
||
138 | * Retrieve payload. |
||
139 | * |
||
140 | * @return array |
||
141 | */ |
||
142 | protected function getCompoundPayload() |
||
156 | } |
||
157 |