예제 #1
0
파일: Vote.php 프로젝트: bariew/sitown
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAnswer()
 {
     return $this->hasOne(Answer::className(), ['id' => 'answer_id'])->from(['answer' => Answer::tableName()]);
 }
예제 #2
0
파일: Question.php 프로젝트: bariew/sitown
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAnswers()
 {
     return $this->hasMany(Answer::className(), ['question_id' => 'id']);
 }