public function __call($method, $args)
{
$prefix = substr($method, 0, 3);
if ($prefix == 'get') {
$prop = lcfirst(substr($method, 3));
if (property_exists($this, $prop)) {
return $this->{$prop};
}
} else {
if ($prefix == 'set') {
$prop = lcfirst(substr($method, 3));
if (property_exists($this, $prop)) {
$this->{$prop} = isset($args[0]) ? $args[0] : null;
return $this;
}
} else {
throw new \BadMethodCallException(sprintf('Could not find method "%s" for the class "%s".', $method, get_class($this)));
}
}
throw new Exception\UpgradeException(sprintf('Property "%s" does not exist for the class "%s".', $prop, get_class($this)));
}