public function __get($name)
{
if (empty($name)) {
throw new Exception('Illegal attribute: field name for Model cannot be empty');
}
if (array_key_exists($name, $this->_attributes)) {
return $this->_attributes[$name];
}
if ($this->_modelDefinition->relations->hasRelation($name)) {
$this->_fetchRelation($name);
return $this->_attributes[$name];
}
return null;
}