1 | <?php |
||
9 | class Language |
||
10 | { |
||
11 | /** |
||
12 | * The attributes array. |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $attributes; |
||
17 | |||
18 | /** |
||
19 | * Create a new Language instance. |
||
20 | * |
||
21 | * @param array $attributes |
||
22 | * |
||
23 | * @throws \Exception |
||
24 | */ |
||
25 | public function __construct($attributes) |
||
35 | |||
36 | /** |
||
37 | * Set the attributes. |
||
38 | * |
||
39 | * @param array $attributes |
||
40 | * |
||
41 | * @return $this |
||
42 | */ |
||
43 | public function setAttributes($attributes) |
||
49 | |||
50 | /** |
||
51 | * Get the attributes. |
||
52 | * |
||
53 | * @return array|null |
||
54 | */ |
||
55 | public function getAttributes(): ?array |
||
59 | |||
60 | /** |
||
61 | * Set single attribute. |
||
62 | * |
||
63 | * @param string $key |
||
64 | * @param mixed $value |
||
65 | * |
||
66 | * @return $this |
||
67 | */ |
||
68 | public function set($key, $value) |
||
74 | |||
75 | /** |
||
76 | * Get an item from attributes array using "dot" notation. |
||
77 | * |
||
78 | * @param string $key |
||
79 | * @param mixed $default |
||
80 | * |
||
81 | * @return mixed |
||
82 | */ |
||
83 | public function get($key, $default = null) |
||
105 | |||
106 | /** |
||
107 | * Get the name. |
||
108 | * |
||
109 | * @return string|null |
||
110 | */ |
||
111 | public function getName(): ?string |
||
115 | |||
116 | /** |
||
117 | * Get the given native name or fallback to first native name. |
||
118 | * |
||
119 | * @return string|null |
||
120 | */ |
||
121 | public function getNativeName(): ?string |
||
125 | |||
126 | /** |
||
127 | * Get the ISO 639-1 code. |
||
128 | * |
||
129 | * @return string|null |
||
130 | */ |
||
131 | public function getIso6391() |
||
135 | |||
136 | /** |
||
137 | * Get the ISO 639-2 code. |
||
138 | * |
||
139 | * @return string|null |
||
140 | */ |
||
141 | public function getIso6392() |
||
145 | |||
146 | /** |
||
147 | * Get the ISO 639-3 code. |
||
148 | * |
||
149 | * @return string|null |
||
150 | */ |
||
151 | public function getIso6393() |
||
155 | |||
156 | /** |
||
157 | * Get the script. |
||
158 | * |
||
159 | * @return array|null |
||
160 | */ |
||
161 | public function getScript(): ?array |
||
165 | |||
166 | /** |
||
167 | * Get the script name. |
||
168 | * |
||
169 | * @return string|null |
||
170 | */ |
||
171 | public function getScriptName(): ?string |
||
175 | |||
176 | /** |
||
177 | * Get the script ISO 15924. |
||
178 | * |
||
179 | * @return string|null |
||
180 | */ |
||
181 | public function getScriptIso15924() |
||
185 | |||
186 | /** |
||
187 | * Get the script ISO numeric. |
||
188 | * |
||
189 | * @return string|null |
||
190 | */ |
||
191 | public function getScriptIsoNumeric(): ?string |
||
195 | |||
196 | /** |
||
197 | * Get the script direction. |
||
198 | * |
||
199 | * @return string|null |
||
200 | */ |
||
201 | public function getScriptDirection(): ?string |
||
205 | |||
206 | /** |
||
207 | * Get the family. |
||
208 | * |
||
209 | * @return array|null |
||
210 | */ |
||
211 | public function getFamily(): ?array |
||
215 | |||
216 | /** |
||
217 | * Get the family name. |
||
218 | * |
||
219 | * @return string|null |
||
220 | */ |
||
221 | public function getFamilyName(): ?string |
||
225 | |||
226 | /** |
||
227 | * Get the family ISO 639-5. |
||
228 | * |
||
229 | * @return string|null |
||
230 | */ |
||
231 | public function getFamilyIso6395() |
||
235 | |||
236 | /** |
||
237 | * Get the family hierarchy. |
||
238 | * |
||
239 | * @return string|null |
||
240 | */ |
||
241 | public function getFamilyHierarchy(): ?string |
||
245 | |||
246 | /** |
||
247 | * Get the scope. |
||
248 | * |
||
249 | * @return string|null |
||
250 | */ |
||
251 | public function getScope(): ?string |
||
255 | |||
256 | /** |
||
257 | * Get the type. |
||
258 | * |
||
259 | * @return string|null |
||
260 | */ |
||
261 | public function getType(): ?string |
||
265 | |||
266 | /** |
||
267 | * Get the cultures. |
||
268 | * |
||
269 | * @return array|null |
||
270 | */ |
||
271 | public function getCultures(): ?array |
||
275 | |||
276 | /** |
||
277 | * Get the given culture. |
||
278 | * |
||
279 | * @param string|null $culture |
||
280 | * |
||
281 | * @return array|null |
||
282 | */ |
||
283 | public function getCulture($culture = null): ?array |
||
287 | } |
||
288 |