public function loadModel($id) { if (($model = EavSet::model()->findByPk($id)) === null) { throw new CHttpException(404, 'Страница не найдена'); } return $model; }
public function testUpdateEavAttributeOrder() { $model = EavSet::model()->findByPk(2); $attr = $model->getEavAttributes(); $keys = array_keys($attr); $this->assertEquals(1, $keys[0]); $this->assertEquals(2, $keys[1]); $model->updateEavAttributeOrder(array(2, 1)); $model = EavSet::model()->findByPk(2); $attr = $model->getEavAttributes(); $keys = array_keys($attr); $this->assertEquals(2, $keys[0]); $this->assertEquals(1, $keys[1]); }
protected function setAttributeInstances() { $set = EavSet::model()->findByPk($this->eav_set_id); $attributes = $set->getEavAttributes(); foreach ($attributes as $attr) { $this->eavAttributeInstances[$attr->name] = $attr; } }
public static function model($className = __CLASS__) { return parent::model($className); }