| Total Complexity | 4 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class Skill extends Model |
||
| 11 | { |
||
| 12 | use CrudTrait; |
||
|
|
|||
| 13 | protected $guarded = ['id']; |
||
| 14 | protected $with = ['level', 'skill_type']; |
||
| 15 | |||
| 16 | /** The category the skill belongs to */ |
||
| 17 | public function skill_type() |
||
| 18 | { |
||
| 19 | return $this->belongsTo(SkillType::class); |
||
| 20 | } |
||
| 21 | |||
| 22 | /** A skill belongs to a level, this allows to filter available skills when attaching them to courses */ |
||
| 23 | public function level() |
||
| 24 | { |
||
| 25 | return $this->belongsTo(Level::class); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** a skill has many courses, and a course has many skills |
||
| 29 | * Skills are like "criteria" that will need to be evaluated during the course |
||
| 30 | */ |
||
| 31 | public function courses() |
||
| 34 | } |
||
| 35 | |||
| 36 | /** A skill is linked to skill evaluations (themselves linked to enrollments) */ |
||
| 37 | public function skill_evaluations() |
||
| 40 | } |
||
| 41 | } |
||
| 42 |