public function __get($name) { switch ($name) { case 'type': return $this->_type; case 'content': return $this->_content; case 'length': return $this->_length; case 'position': return $this->_position; } throw new \InvalidArgumentException(); }