public function __get($key) { if (method_exists($this, 'get_' . $key)) { $value = call_user_func(array($this, 'get_' . $key)); } else { $value = $this->{$key}; } return $value; }