public function __get($name) { $names = array_flip($this->attributeNames()); if (isset($names[$name])) { return isset($this->_attributes[$name]) ? $this->_attributes[$name] : null; } else { return parent::__get($name); } }