public function __get($attr)
{
// Check for meta accessor
$accessor = camel_case('get_' . $attr . '_meta');
if (method_exists($this, $accessor)) {
return $this->{$accessor}();
}
// Check for legacy getter
$getter = 'get' . ucfirst($attr);
// leave model relation methods for parent::
$isRelationship = method_exists($this, $attr);
if (method_exists($this, $getter) && !$isRelationship) {
return $this->{$getter}();
}
return parent::__get($attr);
}