value) */ private $data = array(); /** * Initializes an object */ function __construct() { // } /** * Sets value of a property of current object * * @param string $name Name of property to set * @param object $value Value of property $name */ function __set($name, $value) { $this->data[$name] = $value; } /** * Gets value of a property of current object * * @param string $name Name of property to get * @return string Value of $name or null * @exception $e Exception Sent if $name does not exist */ function __get($name) { try { return $this->data[$name]; } catch (Exception $e) { echo 'Exception catched: '.$e->getMessage().', null returned
'; return null; } } /** * Checks if a given property is set in the current object * * @param string $name Name of property to check * @return Bool */ public function __isset($name) { if (isset($this->data[$name])) return (false === empty($this->data[$name])); else return false; } /** * Gets values of all properties of the current object in an array * * @return Array properties ( key=>value) */ public function getArray() { return $this->data; } /** * Sets values of all properties of the current object * * @param Array $array Array of the properties to set */ public function setArray($array) { $this->data = $array; } } ?>