/** * @return \yii\db\ActiveQuery */ public function getVoteOptions() { return $this->hasMany(VoteOption::className(), ['parent_id' => 'id'])->orderBy(['position' => SORT_ASC]); }
/** * @return \yii\db\ActiveQuery */ public function getParent() { return $this->hasOne(VoteOption::className(), ['id' => 'parent_id']); }
/** * @return \yii\db\ActiveQuery */ public function getOption() { return $this->hasOne(VoteOption::className(), ['id' => 'option_id']); }