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