1 <?php
2
3 /* --------------------------------------------------------------
4 LanguageProviderInterface.inc.php 2016-02-07
5 Gambio GmbH
6 http://www.gambio.de
7 Copyright (c) 2016 Gambio GmbH
8 Released under the GNU General Public License (Version 2)
9 [http://www.gnu.org/licenses/gpl-2.0.html]
10 --------------------------------------------------------------
11 */
12
13 /**
14 * Interface LanguageProviderInterface
15 *
16 * @category System
17 * @package Shared
18 * @subpackage Interfaces
19 */
20 interface LanguageProviderInterface
21 {
22 /**
23 * Returns the language IDs.
24 *
25 * @throws UnexpectedValueException If no ID has been found.
26 * @throws InvalidArgumentException If ID is not valid.
27 *
28 * @return IdCollection
29 */
30 public function getIds();
31
32
33 /**
34 * Returns the language codes.
35 *
36 * @throws UnexpectedValueException If no code has been found.
37 * @throws InvalidArgumentException If code is not valid.
38 *
39 * @return KeyValueCollection
40 */
41 public function getCodes();
42
43
44 /**
45 * Returns the language code from a specific language, selected by the language ID.
46 *
47 * @param IdType $id Language ID.
48 *
49 * @throws UnexpectedValueException If no code has been found.
50 * @throws InvalidArgumentException If code is not valid.
51 *
52 * @return LanguageCode
53 */
54 public function getCodeById(IdType $id);
55
56
57 /**
58 * Returns the directory from the a specific language, selected by the language ID.
59 *
60 * @param IdType $id Language ID.
61 *
62 * @throws UnexpectedValueException If no directory has been found.
63 * @throws InvalidArgumentException If code is not valid.
64 *
65 * @return string
66 */
67 public function getDirectoryById(IdType $id);
68
69
70 /**
71 * Returns the ID from the a specific language, selected by the language code.
72 *
73 * @param LanguageCode $code Language code.
74 *
75 * @throws UnexpectedValueException If no ID has been found.
76 *
77 * @return int
78 */
79 public function getIdByCode(LanguageCode $code);
80
81
82 /**
83 * Returns the directory from the a specific language, selected by the language code.
84 *
85 * @param LanguageCode $code Language code.
86 *
87 * @throws UnexpectedValueException If no directory has been found.
88 *
89 * @return string
90 */
91 public function getDirectoryByCode(LanguageCode $code);
92
93
94 /**
95 * Returns the active language codes.
96 *
97 * @throws InvalidArgumentException If code is not valid.
98 *
99 * @return KeyValueCollection
100 */
101 public function getActiveCodes();
102 }