From 16adf8e6158154f6a7f8e6f57cfb608dfff2ff6e Mon Sep 17 00:00:00 2001 From: Cody Darst Date: Tue, 9 Jan 2018 15:57:40 -0600 Subject: [PATCH] Fixed PHP Fatal error. Implemented ArrayAccess methods to allow array operator access to class properties. fixes NagiosEnterprises/nagiosvshell#20 --- .../libraries/factory/NagiosObject.php | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/www/api/application/libraries/factory/NagiosObject.php b/www/api/application/libraries/factory/NagiosObject.php index e286eccd..2ac85c9c 100644 --- a/www/api/application/libraries/factory/NagiosObject.php +++ b/www/api/application/libraries/factory/NagiosObject.php @@ -100,5 +100,23 @@ public function get_type(){ return $this->_type; } + public function offsetExists ($offset) + { + return isset($this->$offset); + } + + public function offsetGet ($offset) + { + return $this->$offset; + } -} \ No newline at end of file + public function offsetSet ($offset, $value) + { + $this->$offset = $value; + } + + public function offsetUnset ($offset) + { + unset($this->$offset); + } +}