public function __get($name)
{
$getter = 'get' . $name;
if (method_exists($this, $getter)) {
return $this->{$getter}();
} elseif (method_exists($this, 'set' . $name)) {
throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name);
} else {
throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name);
}
}