1 | <?php |
||
11 | class OneSignalMessage |
||
12 | { |
||
13 | |||
14 | use AppearanceHelpers, AttachmentHelpers, ButtonHelpers, DeliveryHelpers, GroupingHelpers, SilentHelpers, Deprecated; |
||
15 | |||
16 | /** @var array */ |
||
17 | protected $payload = []; |
||
18 | |||
19 | /** |
||
20 | * @param string $body |
||
21 | * |
||
22 | * @return static |
||
23 | */ |
||
24 | 1 | public static function create($body = '') |
|
28 | |||
29 | /** |
||
30 | * @param string $body |
||
31 | */ |
||
32 | 21 | public function __construct($body = '') |
|
36 | |||
37 | |||
38 | /** |
||
39 | * Set the message body. |
||
40 | * |
||
41 | * @param mixed $value |
||
42 | * |
||
43 | * @return $this |
||
44 | */ |
||
45 | 21 | public function setBody($value) |
|
49 | |||
50 | |||
51 | /** |
||
52 | * Set the message subject. |
||
53 | * |
||
54 | * @param mixed $value |
||
55 | * |
||
56 | * @return $this |
||
57 | */ |
||
58 | 1 | public function setSubject($value) |
|
62 | |||
63 | |||
64 | /** |
||
65 | * Set the message template_id |
||
66 | * |
||
67 | * @param string $value |
||
68 | * |
||
69 | * @return $this |
||
70 | */ |
||
71 | public function setTemplate($value) |
||
76 | |||
77 | /** |
||
78 | * @param mixed $value |
||
79 | * |
||
80 | * @return array |
||
81 | */ |
||
82 | 21 | protected function parseValueToArray($value) |
|
86 | |||
87 | |||
88 | /** |
||
89 | * Set additional data. |
||
90 | * |
||
91 | * @param string $key |
||
92 | * @param mixed $value |
||
93 | * |
||
94 | * @return $this |
||
95 | */ |
||
96 | 1 | public function setData(string $key, $value) |
|
100 | |||
101 | /** |
||
102 | * Set parameters. |
||
103 | * |
||
104 | * @param string $key |
||
105 | * @param mixed $value |
||
106 | * |
||
107 | * @return $this |
||
108 | */ |
||
109 | 21 | public function setParameter(string $key, $value) |
|
115 | |||
116 | /** |
||
117 | * Get parameters. |
||
118 | * |
||
119 | * @param string $key |
||
120 | * @param mixed $default |
||
121 | * |
||
122 | * @return mixed |
||
123 | */ |
||
124 | 3 | public function getParameter(string $key, $default = null) |
|
128 | |||
129 | /** |
||
130 | * @return array |
||
131 | */ |
||
132 | 21 | public function toArray() |
|
136 | } |
||
137 |