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