1 | <?php |
||
8 | class Sms |
||
9 | { |
||
10 | /** |
||
11 | * @var string[] |
||
12 | */ |
||
13 | private $recipients; |
||
14 | |||
15 | /** |
||
16 | * @var string[][] |
||
17 | */ |
||
18 | private $recipientVariables; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $text; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $userReference; |
||
29 | |||
30 | /** |
||
31 | * Sms constructor. |
||
32 | */ |
||
33 | 5 | public function __construct() |
|
34 | { |
||
35 | 5 | $this->recipients = []; |
|
36 | 5 | $this->recipientVariables = []; |
|
37 | 5 | } |
|
38 | |||
39 | /** |
||
40 | * @return static |
||
41 | */ |
||
42 | 5 | public static function create() |
|
43 | { |
||
44 | 5 | return new static(); |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * @return string[] |
||
49 | */ |
||
50 | 5 | public function getRecipients() |
|
54 | |||
55 | /** |
||
56 | * @param string[] $recipients |
||
57 | * |
||
58 | * @return $this |
||
59 | */ |
||
60 | 4 | public function setRecipients(array $recipients) |
|
61 | { |
||
62 | 4 | $this->recipients = $recipients; |
|
63 | |||
64 | 4 | return $this; |
|
65 | } |
||
66 | |||
67 | /** |
||
68 | * @param string $recipient |
||
69 | * |
||
70 | * @return $this |
||
71 | */ |
||
72 | public function addRecipient($recipient) |
||
78 | |||
79 | /** |
||
80 | * @param string $recipient |
||
81 | * |
||
82 | * @return $this |
||
83 | */ |
||
84 | public function removeTo($recipient) |
||
94 | |||
95 | /** |
||
96 | * @return bool |
||
97 | */ |
||
98 | 5 | public function hasRecipients() |
|
102 | |||
103 | /** |
||
104 | * @return string[][] |
||
105 | */ |
||
106 | 4 | public function getRecipientVariables() |
|
110 | |||
111 | /** |
||
112 | * @param string $recipient |
||
113 | * @param string[] $recipientVariables |
||
114 | * |
||
115 | * @return $this |
||
116 | */ |
||
117 | 1 | public function setRecipientVariables($recipient, array $recipientVariables) |
|
118 | { |
||
119 | 1 | $this->recipientVariables[$recipient] = $recipientVariables; |
|
120 | |||
121 | 1 | return $this; |
|
122 | } |
||
123 | |||
124 | /** |
||
125 | * @param string $recipient |
||
126 | * @param string $recipientVariable |
||
127 | * @param string $recipientVariableValue |
||
128 | * |
||
129 | * @return $this |
||
130 | */ |
||
131 | public function addRecipientVariable($recipient, $recipientVariable, $recipientVariableValue) |
||
141 | |||
142 | /** |
||
143 | * @param string $recipient |
||
144 | * @param string $recipientVariable |
||
145 | * |
||
146 | * @return $this |
||
147 | */ |
||
148 | public function removeRecipientVariable($recipient, $recipientVariable) |
||
154 | |||
155 | /** |
||
156 | * @return bool |
||
157 | */ |
||
158 | public function hasRecipientVariables() |
||
162 | |||
163 | /** |
||
164 | * @return $this |
||
165 | */ |
||
166 | public function clearRecipientVariables() |
||
172 | |||
173 | /** |
||
174 | * @return string |
||
175 | */ |
||
176 | 4 | public function getText() |
|
180 | |||
181 | /** |
||
182 | * @param string $text |
||
183 | * |
||
184 | * @return $this |
||
185 | */ |
||
186 | 5 | public function setText($text) |
|
187 | { |
||
188 | 5 | $this->text = $text; |
|
189 | |||
190 | 5 | return $this; |
|
191 | } |
||
192 | |||
193 | /** |
||
194 | * @return string |
||
195 | */ |
||
196 | 4 | public function getUserReference() |
|
200 | |||
201 | /** |
||
202 | * @param string $userReference |
||
203 | * |
||
204 | * @return $this |
||
205 | */ |
||
206 | public function setUserReference($userReference) |
||
212 | } |
||
213 |