/** * @return \yii\db\ActiveQuery */ public function getPrevSection() { return $this->hasOne(Section::className(), ['id' => 'prev']); }
/** * @return ActiveQuery */ public function getSections() { return $this->hasMany(Section::className(), ['category_id' => 'id']); }
/** * @return ActiveQuery */ public function getSection() { return $this->hasOne(Section::className(), ['id' => 'section_id']); }
/** * @return ActiveQuery */ public function getChildren() { return $this->hasMany(Section::className(), ['section_id' => 'id'])->inverseOf('parent'); }