1 | <?php |
||
8 | class Message |
||
9 | { |
||
10 | /** |
||
11 | * @var int |
||
12 | * |
||
13 | * This is the number of times the message occurs on a specific page |
||
14 | */ |
||
15 | private $count; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | * |
||
20 | * The domain the message belongs to |
||
21 | */ |
||
22 | private $domain; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | * |
||
27 | * The key/phrase you write in the source code |
||
28 | */ |
||
29 | private $id; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | * |
||
34 | * The locale the translations is on |
||
35 | */ |
||
36 | private $locale; |
||
37 | |||
38 | /** |
||
39 | * @var int |
||
40 | * |
||
41 | * The current state of the translations. See Symfony\Component\Translation\DataCollectorTranslator |
||
42 | * |
||
43 | * MESSAGE_DEFINED = 0; |
||
44 | * MESSAGE_MISSING = 1; |
||
45 | * MESSAGE_EQUALS_FALLBACK = 2; |
||
46 | */ |
||
47 | private $state; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | * |
||
52 | * The translated string. This is the preview of the message. Ie no placeholders is visible. |
||
53 | */ |
||
54 | private $translation; |
||
55 | |||
56 | /** |
||
57 | * @var int |
||
58 | * |
||
59 | * The number which we are feeding a transChoice with |
||
60 | * Used only in Symfony >2.8 |
||
61 | */ |
||
62 | private $transChoiceNumber; |
||
63 | |||
64 | /** |
||
65 | * @var array |
||
66 | * |
||
67 | * The parameters sent to the translations |
||
68 | * Used only in Symfony >2.8 |
||
69 | */ |
||
70 | private $parameters; |
||
71 | |||
72 | /** |
||
73 | * @param array $data |
||
74 | * array( count = 1, domain = "navigation", id = "logout", locale = "sv", state = 1, translation = "logout" ) |
||
75 | */ |
||
76 | public function __construct($data) |
||
96 | |||
97 | /** |
||
98 | * @return int |
||
99 | */ |
||
100 | public function getCount() |
||
104 | |||
105 | /** |
||
106 | * @param int $count |
||
107 | * |
||
108 | * @return $this |
||
109 | */ |
||
110 | public function setCount($count) |
||
116 | |||
117 | /** |
||
118 | * @return string |
||
119 | */ |
||
120 | public function getDomain() |
||
124 | |||
125 | /** |
||
126 | * @param string $domain |
||
127 | * |
||
128 | * @return $this |
||
129 | */ |
||
130 | public function setDomain($domain) |
||
136 | |||
137 | /** |
||
138 | * @return string |
||
139 | */ |
||
140 | public function getId() |
||
144 | |||
145 | /** |
||
146 | * @param string $id |
||
147 | * |
||
148 | * @return $this |
||
149 | */ |
||
150 | public function setId($id) |
||
156 | |||
157 | /** |
||
158 | * @return string |
||
159 | */ |
||
160 | public function getLocale() |
||
164 | |||
165 | /** |
||
166 | * @param string $locale |
||
167 | * |
||
168 | * @return $this |
||
169 | */ |
||
170 | public function setLocale($locale) |
||
176 | |||
177 | /** |
||
178 | * @return int |
||
179 | */ |
||
180 | public function getState() |
||
184 | |||
185 | /** |
||
186 | * @param int $state |
||
187 | * |
||
188 | * @return $this |
||
189 | */ |
||
190 | public function setState($state) |
||
196 | |||
197 | /** |
||
198 | * @return string |
||
199 | */ |
||
200 | public function getTranslation() |
||
204 | |||
205 | /** |
||
206 | * @param string $translation |
||
207 | * |
||
208 | * @return $this |
||
209 | */ |
||
210 | public function setTranslation($translation) |
||
216 | |||
217 | /** |
||
218 | * @return int |
||
219 | */ |
||
220 | public function getTransChoiceNumber() |
||
224 | |||
225 | /** |
||
226 | * @param int $transChoiceNumber |
||
227 | * |
||
228 | * @return $this |
||
229 | */ |
||
230 | public function setTransChoiceNumber($transChoiceNumber) |
||
236 | |||
237 | /** |
||
238 | * @return array |
||
239 | */ |
||
240 | public function getParameters() |
||
244 | |||
245 | /** |
||
246 | * @return bool |
||
247 | */ |
||
248 | public function hasParameters() |
||
252 | |||
253 | /** |
||
254 | * @param array $parameters |
||
255 | * |
||
256 | * @return $this |
||
257 | */ |
||
258 | public function setParameters($parameters) |
||
264 | } |
||
265 |