예제 #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCourse()
 {
     return $this->hasOne(Course::className(), ['id' => 'course_id']);
 }
예제 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCourses()
 {
     return $this->hasMany(Course::className(), ['institute_id' => 'id']);
 }
예제 #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCourses()
 {
     return $this->hasMany(Course::className(), ['id' => 'course_id'])->viaTable('user_has_course', ['user_id' => 'id']);
 }