public function __get($name) { try { return parent::__get($name); } catch (Exception $e) { if (strpos($name, '.') !== FALSE) { return MtModelDotNameAttributeTrait::getDotNameAttribute($this->owner, $name); } throw $e; } }
/** * @param null $attributes * @param bool $clearErrors * @return bool */ public function validate($attributes = NULL, $clearErrors = TRUE) { $isValid = TRUE; if ($clearErrors) { $this->clearErrors(); } foreach ($this->_fieldInstances as $name => $field) { $value = $attributes ? MtModelDotNameAttributeTrait::getDotNameAttribute($attributes, $name) : $this->{$name}; $isValid &= (bool) $field->validate($value); } return $isValid && parent::validate($attributes, FALSE); }