1 | <?php |
||
34 | class Localize extends \Tight\Modules\AbstractModule |
||
35 | { |
||
36 | |||
37 | /** |
||
38 | * @var string Resource file type |
||
39 | */ |
||
40 | private $resourceFileType; |
||
41 | |||
42 | /** |
||
43 | * @var string Current locale |
||
44 | */ |
||
45 | private $locale; |
||
46 | |||
47 | /** |
||
48 | * @var array Associative array for the current locale |
||
49 | */ |
||
50 | private $values; |
||
51 | |||
52 | /** |
||
53 | * Constructor |
||
54 | * |
||
55 | * @param array|\Tight\Modules\Localize\LocalizeConfig $config |
||
56 | * @throws \InvalidArgumentException If $config is not an array or an object |
||
57 | * of \Tight\Modules\Localize\LocalizeConfig class |
||
58 | */ |
||
59 | public function __construct($config = []) { |
||
71 | |||
72 | /** |
||
73 | * Sets the resource file type |
||
74 | * @param string $resourceFileType Resource file type |
||
75 | * @return \Tight\Modules\Localize\Localize Fluent setter |
||
76 | */ |
||
77 | public function setResourceFileType($resourceFileType) { |
||
81 | |||
82 | /** |
||
83 | * Gets all the defined values for the current locale |
||
84 | * @return array Associative array of values |
||
85 | */ |
||
86 | public function getValues() { |
||
89 | |||
90 | /** |
||
91 | * Reloads the class with the new locale |
||
92 | */ |
||
93 | public function reloadConfig() { |
||
96 | |||
97 | /** |
||
98 | * Checks the dependences for the class |
||
99 | * @throws \Tight\Modules\ModuleException If resource directory cant be |
||
100 | * found |
||
101 | */ |
||
102 | private function checkDependences() { |
||
107 | |||
108 | /** |
||
109 | * Sets a new locale |
||
110 | * @param string $locale New defined locale |
||
111 | * @throws \Tight\Modules\ModuleException If resource default resource file |
||
112 | * cant be found |
||
113 | */ |
||
114 | public function setLocale($locale) { |
||
131 | |||
132 | /** |
||
133 | * Gets the available locales |
||
134 | * @return array Available locales |
||
135 | */ |
||
136 | public function getLocales() { |
||
163 | |||
164 | /** |
||
165 | * Gets a value from a defined key |
||
166 | * @param string $key Key |
||
167 | * @return string Value defined for the key $key or an empty string if the |
||
168 | * key is not defined |
||
169 | */ |
||
170 | public function get($key) { |
||
177 | |||
178 | public function onConfigChange() { |
||
181 | |||
182 | public function onLoad() { |
||
185 | |||
186 | public function onRemove() { |
||
189 | |||
190 | } |
||
191 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.