diff options
author | MaZderMind | 2016-12-18 13:34:57 +0100 |
---|---|---|
committer | MaZderMind | 2016-12-18 13:34:57 +0100 |
commit | a12d86ec058bc89e6feeda6ec8cfce691269b0a9 (patch) | |
tree | 6be1f764a8addd025eb774bcd2039788a4b1873f /model/ModelBase.php | |
parent | 521f0e2e1c94538fdce65a021144180f368364d9 (diff) | |
parent | efd0b59f8ed363e12211894d8892e4d18b198c04 (diff) |
Merge branch 'master' into events/33c3
Diffstat (limited to 'model/ModelBase.php')
-rw-r--r-- | model/ModelBase.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/model/ModelBase.php b/model/ModelBase.php index 7b1370b..41f329b 100644 --- a/model/ModelBase.php +++ b/model/ModelBase.php @@ -2,14 +2,17 @@ class ModelBase { - protected function has($keychain) + protected $config; + public function __construct($config) { - return ModelBase::_has($GLOBALS['CONFIG'], $keychain); + $this->config = $config; } - protected static function staticHas($keychain) + + public function has($keychain) { - return ModelBase::_has($GLOBALS['CONFIG'], $keychain); + return ModelBase::_has($this->config, $keychain); } + private static function _has($array, $keychain) { if(!is_array($keychain)) @@ -25,14 +28,11 @@ class ModelBase return ModelBase::_has($array[$key], array_slice($keychain, 1)); } - protected function get($keychain, $default = null) + public function get($keychain, $default = null) { - return ModelBase::_get($GLOBALS['CONFIG'], $keychain, $default); - } - protected static function staticGet($keychain, $default = null) - { - return ModelBase::_get($GLOBALS['CONFIG'], $keychain, $default); + return ModelBase::_get($this->config, $keychain, $default); } + private static function _get($array, $keychain, $default) { if(!is_array($keychain)) |