diff options
author | arron <arron@copiadigital.co.uk> | 2013-12-05 18:28:08 +0000 |
---|---|---|
committer | arron <arron@copiadigital.co.uk> | 2013-12-05 18:28:08 +0000 |
commit | e0fd2e51a5546d0d85cf249a6ebf45f9e06e6017 (patch) | |
tree | b7f17446bd2cbdb7dda26d04cbdc65679c8557f2 /library/SSRS/Object/Abstract.php | |
parent | e4ee94dbc8be64f9b53f1a323a314a60d0ac86d3 (diff) | |
download | php-ssrs-e0fd2e51a5546d0d85cf249a6ebf45f9e06e6017.zip php-ssrs-e0fd2e51a5546d0d85cf249a6ebf45f9e06e6017.tar.gz php-ssrs-e0fd2e51a5546d0d85cf249a6ebf45f9e06e6017.tar.bz2 |
Namespaced
Diffstat (limited to 'library/SSRS/Object/Abstract.php')
-rwxr-xr-x | library/SSRS/Object/Abstract.php | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/library/SSRS/Object/Abstract.php b/library/SSRS/Object/Abstract.php deleted file mode 100755 index 4658b48..0000000 --- a/library/SSRS/Object/Abstract.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -/** - * SSRS_Object_Abstract - * - * @author arron - */ -class SSRS_Object_Abstract { - - public $data = array(); - - public function __construct($data = null) { - $this->init(); - $this->setData($data); - } - - public function init() { - - } - - public function setData($data) { - $clean = $this->_sanitizeData($data); - - if (is_array($clean)) { - foreach ($clean AS $key => $value) { - $this->$key = $value; - } - } - - return $this; - } - - public function __set($key, $value) { - $methodName = 'set' . ucfirst($key); - if (method_exists($this, $methodName)) { - $this->$methodName($value); - } else { - $this->data[$key] = $value; - } - } - - protected function _sanitizeData($data, $recursive = false) { - if (is_object($data)) { - $data = get_object_vars($data); - } - - if ($recursive && is_array($data)) { - foreach ($data AS $key => $value) { - $data[$key] = $this->_sanitizeData($value); - } - } - - return $data; - } - - public function __get($key) { - return isset($this->data[$key]) ? $this->data[$key] : null; - } - -}
\ No newline at end of file |