public function getCourse()
 {
     return $this->hasOne(GymCourse::className(), ['id' => 'gym_course_id']);
 }
예제 #2
0
 public function getCourses()
 {
     return $this->hasMany(GymCourse::className(), ['gym_id' => 'id'])->where(['status' => GymCourse::STATUS_ACTIVE])->orderBy('id');
 }