1 | <?php |
||
15 | class MslsLanguageArray { |
||
16 | |||
17 | /** |
||
18 | * Generic container |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $arr; |
||
22 | |||
23 | /** |
||
24 | * Constructor |
||
25 | * @param array $arr |
||
26 | */ |
||
27 | public function __construct( array $arr = [] ) { |
||
32 | |||
33 | /** |
||
34 | * Set a key-value-pair |
||
35 | * - $key must be a string of length >= 2 |
||
36 | * - $value must be an integer > 0 |
||
37 | * @param string $key |
||
38 | * @param mixed $value |
||
39 | * @return MslsLanguageArray |
||
40 | */ |
||
41 | public function set( $key, $value ) { |
||
48 | |||
49 | |||
50 | /** |
||
51 | * Get the value of the element with the specified key |
||
52 | * @param string $key |
||
53 | * @return int |
||
54 | */ |
||
55 | public function get_val( $key ) { |
||
58 | |||
59 | /** |
||
60 | * Get the filtered array without the specified element |
||
61 | * @param string $key |
||
62 | * @return array |
||
63 | */ |
||
64 | public function get_arr( $key = '' ) { |
||
71 | |||
72 | } |
||
73 |