public function __get($name) { if (property_exists($this, $name)) { $method = 'get' . ucwords($name); return $this->{$method}(); } }