/** * Задает модель связанного элемента * @param \bxar\ActiveRecord $model */ public function setRelated(\bxar\ActiveRecord $model) { $id = $model->getAttributeValue('ID'); if ($id) { $this->setValue($id); $this->_related = $model; } }
/** * Возвращает список всех имен атрибутов модели * @return array */ protected function getAttributesNames() { $return = parent::getAttributesNames(); if (!empty($this->_initOnDemand)) { $return = array_merge($return, array_keys($this->_initOnDemand)); } return $return; }