public function __get($name) { switch ($name) { case 'type': return $this->type; default: return parent::__get($name); } }