_data = array( 'id' => $id, 'start' => $start, 'expiry' => $expiry, 'permissions' => $permissions ); } /** * Magic overload for setting properties * * @param string $name Name of the property * @param string $value Value to set */ public function __set($name, $value) { if (array_key_exists(strtolower($name), $this->_data)) { $this->_data[strtolower($name)] = $value; return; } throw new Exception("Unknown property: " . $name); } /** * Magic overload for getting properties * * @param string $name Name of the property */ public function __get($name) { if (array_key_exists(strtolower($name), $this->_data)) { return $this->_data[strtolower($name)]; } throw new Exception("Unknown property: " . $name); } }