Ejemplo n.º 1
0
 public function getCourses()
 {
     return $this->hasMany(Courses::className(), ['id' => 'course_id'])->viaTable(StudentsCourses::tableName(), ['student_id' => 'id'])->all();
 }
Ejemplo n.º 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStudentsCourses()
 {
     return $this->hasMany(StudentsCourses::className(), ['course_id' => 'id']);
 }