/** * Is property defined? * @param string property name * @return bool */ public function __isset($key) { return isset($this->data[$key]) || parent::__isset($key); }
/** * * automatic creation of getters/setters * * catch set[Field_name]() and get[Field_name]() * * @param $name * @param $args * @return mixed */ public function __call($name, $args) { $get_or_set = substr($name, 0, 3); $field = substr($name, 3); switch ($get_or_set) { case "get": return $this->get($field); break; case "set": if (count($args) > 0) { $this->set($field, $args[0]); } else { return parent::__call($name, $args); } break; default: return parent::__call($name, $args); } }