public function init() { $this->name = "Управление контентом"; $this->modelShowAttribute = "name"; $this->modelClassName = CmsContent::className(); parent::init(); }
/** * @return \yii\db\ActiveQuery */ public function getCmsContent() { return $this->hasOne(CmsContent::className(), ['id' => 'content_id']); }
/** * @return \yii\db\ActiveQuery */ public function getCmsContents() { return $this->hasMany(CmsContent::className(), ['content_type' => 'code'])->orderBy("priority ASC")->andWhere(['active' => Cms::BOOL_Y]); }
/** * version > 2.4.8 * @return \yii\db\ActiveQuery */ public function getChildrenContents() { return $this->hasMany(CmsContent::className(), ['parent_content_id' => 'id']); }