public function __get($key) { if (method_exists($this, $key)) { return $this->{$key}(); } return parent::__get($key); }