public function __call($function, $arguments)
{
// Getters following the pattern 'get_{$property}'
if (substr($function, 0, 4) == 'get_') {
$model_props = $this->properties();
$property = substr($function, 4);
if (array_key_exists($property, $model_props)) {
return $this->{$property};
}
}
// Setters following the pattern 'set_{$property}'
if (substr($function, 0, 4) == 'set_') {
$model_props = $this->properties();
$property = substr($function, 4);
if (array_key_exists($property, $model_props)) {
$this->{$property} = $arguments[0];
}
}
}