1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* This file is part of the FirebaseCloudMessagingBundle |
4
|
|
|
* |
5
|
|
|
* (c) Artem Henvald <[email protected]> |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
declare(strict_types=1); |
12
|
|
|
|
13
|
|
|
namespace Fresh\FirebaseCloudMessagingBundle\Message\Part\Payload\Notification; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* AbstractMobileNotificationPayload. |
17
|
|
|
* |
18
|
|
|
* @author Artem Henvald <[email protected]> |
19
|
|
|
*/ |
20
|
|
|
abstract class AbstractMobileNotificationPayload extends AbstractCommonNotificationPayload |
21
|
|
|
{ |
22
|
|
|
/** @var string */ |
23
|
|
|
private $sound; |
24
|
|
|
|
25
|
|
|
/** @var string */ |
26
|
|
|
private $bodyLocKey; |
27
|
|
|
|
28
|
|
|
/** @var string[] */ |
29
|
|
|
private $bodyLocArgs; |
30
|
|
|
|
31
|
|
|
/** @var string */ |
32
|
|
|
private $titleLocKey; |
33
|
|
|
|
34
|
|
|
/** @var string[] */ |
35
|
|
|
private $titleLocArgs; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @param string $sound |
39
|
|
|
* |
40
|
|
|
* @return $this |
41
|
|
|
*/ |
42
|
|
|
public function setSound(string $sound): self |
43
|
|
|
{ |
44
|
|
|
$this->sound = $sound; |
45
|
|
|
|
46
|
|
|
return $this; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @return string |
51
|
|
|
*/ |
52
|
|
|
public function getSound(): string |
53
|
|
|
{ |
54
|
|
|
return $this->sound; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @param string $bodyLocKey |
59
|
|
|
* |
60
|
|
|
* @return $this |
61
|
|
|
*/ |
62
|
|
|
public function setBodyLocKey(string $bodyLocKey): self |
63
|
|
|
{ |
64
|
|
|
$this->bodyLocKey = $bodyLocKey; |
65
|
|
|
|
66
|
|
|
return $this; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @return string |
71
|
|
|
*/ |
72
|
|
|
public function getBodyLocKey(): string |
73
|
|
|
{ |
74
|
|
|
return $this->bodyLocKey; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @param string[] $bodyLocArgs |
79
|
|
|
* |
80
|
|
|
* @return $this |
81
|
|
|
*/ |
82
|
|
|
public function setBodyLocArgs(array $bodyLocArgs): self |
83
|
|
|
{ |
84
|
|
|
foreach ($bodyLocArgs as &$bodyLocArg) { |
85
|
|
|
$bodyLocArg = (string) $bodyLocArg; |
86
|
|
|
} |
87
|
|
|
$this->bodyLocArgs = $bodyLocArgs; |
88
|
|
|
|
89
|
|
|
return $this; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @return string[] |
94
|
|
|
*/ |
95
|
|
|
public function getBodyLocArgs(): array |
96
|
|
|
{ |
97
|
|
|
return $this->bodyLocArgs; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @param string $titleLocKey |
102
|
|
|
* |
103
|
|
|
* @return $this |
104
|
|
|
*/ |
105
|
|
|
public function setTitleLocKey(string $titleLocKey): self |
106
|
|
|
{ |
107
|
|
|
$this->titleLocKey = $titleLocKey; |
108
|
|
|
|
109
|
|
|
return $this; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @return string |
114
|
|
|
*/ |
115
|
|
|
public function getTitleLocKey(): string |
116
|
|
|
{ |
117
|
|
|
return $this->titleLocKey; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @param string[] $titleLocArgs |
122
|
|
|
* |
123
|
|
|
* @return $this |
124
|
|
|
*/ |
125
|
|
|
public function setTitleLocArgs(array $titleLocArgs): self |
126
|
|
|
{ |
127
|
|
|
foreach ($titleLocArgs as &$titleLocArg) { |
128
|
|
|
$titleLocArg = (string) $titleLocArg; |
129
|
|
|
} |
130
|
|
|
$this->titleLocArgs = $titleLocArgs; |
131
|
|
|
|
132
|
|
|
return $this; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @return string[] |
137
|
|
|
*/ |
138
|
|
|
public function getTitleLocArgs(): array |
139
|
|
|
{ |
140
|
|
|
return $this->titleLocArgs; |
141
|
|
|
} |
142
|
|
|
} |
143
|
|
|
|