diff options
author | jaysmith6811@gmail.com <jaysmith6811@gmail.com@deae1e92-32f9-c189-e222-5b9b5081a27a> | 2012-09-25 15:50:03 +0000 |
---|---|---|
committer | jaysmith6811@gmail.com <jaysmith6811@gmail.com@deae1e92-32f9-c189-e222-5b9b5081a27a> | 2012-09-25 15:50:03 +0000 |
commit | e5402b28c9a3f22030f40a4fa179a3bcf6480b7c (patch) | |
tree | 57891e35a4519edf97fbe3a390aef879bb133977 /library/SSRS/Object/Properties.php | |
parent | d5fc5d659d7c6f76b07f781f253b67835f1b1dd1 (diff) | |
download | php-ssrs-e5402b28c9a3f22030f40a4fa179a3bcf6480b7c.zip php-ssrs-e5402b28c9a3f22030f40a4fa179a3bcf6480b7c.tar.gz php-ssrs-e5402b28c9a3f22030f40a4fa179a3bcf6480b7c.tar.bz2 |
Execution info object, getExecutionInfo method
Diffstat (limited to 'library/SSRS/Object/Properties.php')
-rw-r--r-- | library/SSRS/Object/Properties.php | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/library/SSRS/Object/Properties.php b/library/SSRS/Object/Properties.php new file mode 100644 index 0000000..6765450 --- /dev/null +++ b/library/SSRS/Object/Properties.php @@ -0,0 +1,58 @@ +<?php + +class SSRS_Object_Properties { + + protected $_properties = array(); + + public function __construct($properties = array()) { + $this->addProperties($properties); + } + + public function __get($name){ + return $this->getProperty($name); + } + + /** + * + * @param array $properties + */ + public function addProperties(array $properties) { + foreach ($properties AS $key => $value) { + if (is_object($value) && isset($value->Name)) { + $key = $value->Name; + $value = isset($value->Value)? $value->Value : null; + } + + $this->addProperty($key, $value); + } + } + + /** + * + * @param string $key + * @param mixed $value + * @return \SSRS_Object_Properties + */ + public function addProperty($key, $value) { + $this->_properties[$key] = $value; + return $this; + } + + /** + * + * @return array + */ + public function getProperties() { + return $this->_properties; + } + + /** + * + * @param string $key + * @return mixed + */ + public function getProperty($key) { + return array_key_exists($key, $this->_properties) ? $this->_properties[$key] : null; + } + +}
\ No newline at end of file |