/** * @return \yii\db\ActiveQuery */ public function getPage() { return $this->hasOne(ContentPage::className(), ['id' => 'page_id']); }
/** * @return \yii\db\ActiveQuery */ public function getChildren() { return $this->hasMany(ContentPage::className(), ['parent_id' => 'id']); }