public function getPeriodPreferences() { return $this->hasMany(PeriodType::className(), ['id' => 'period_type_id'])->viaTable('student_period_preference', ['student_id' => 'id'])->all(); }
/** * @return The PeriodTypes */ public function getPeriodTypes() { return $this->hasMany(PeriodType::className(), ['id' => 'duration_id'])->viaTable('vacancy_period', ['vacancy_id' => 'id']); }
public static function getDurationsList() { $periods = PeriodType::find()->all(); return ArrayHelper::map($periods, 'id', 'duration'); }