| Total Complexity | 7 |
| Total Lines | 78 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | class Criteria extends BaseModel |
||
| 35 | { |
||
| 36 | |||
| 37 | use HasTranslations; |
||
| 38 | |||
| 39 | public $translatable = ['description', 'specificity']; |
||
|
1 ignored issue
–
show
|
|||
| 40 | |||
| 41 | protected $table = 'criteria'; |
||
|
1 ignored issue
–
show
|
|||
| 42 | |||
| 43 | protected $casts = [ |
||
|
1 ignored issue
–
show
|
|||
| 44 | 'criteria_type_id' => 'int', |
||
| 45 | 'job_poster_id' => 'int', |
||
| 46 | 'skill_id' => 'int', |
||
| 47 | 'skill_level_id' => 'int', |
||
| 48 | ]; |
||
| 49 | protected $fillable = [ |
||
|
1 ignored issue
–
show
|
|||
| 50 | 'skill_id', |
||
| 51 | 'criteria_type_id', |
||
| 52 | 'skill_level_id', |
||
| 53 | ]; |
||
| 54 | protected $with = [ |
||
|
1 ignored issue
–
show
|
|||
| 55 | 'criteria_type', |
||
| 56 | 'skill', |
||
| 57 | 'skill_level' |
||
| 58 | ]; |
||
| 59 | |||
| 60 | public function criteria_type() //phpcs:ignore |
||
| 61 | { |
||
| 62 | return $this->belongsTo(\App\Models\Lookup\CriteriaType::class); |
||
| 63 | } |
||
| 64 | |||
| 65 | public function job_poster() //phpcs:ignore |
||
| 66 | { |
||
| 67 | return $this->belongsTo(\App\Models\JobPoster::class); |
||
| 68 | } |
||
| 69 | |||
| 70 | public function skill() |
||
|
2 ignored issues
–
show
|
|||
| 71 | { |
||
| 72 | return $this->belongsTo(\App\Models\Skill::class); |
||
| 73 | } |
||
| 74 | |||
| 75 | public function skill_level() //phpcs:ignore |
||
| 76 | { |
||
| 77 | return $this->belongsTo(\App\Models\Lookup\SkillLevel::class); |
||
| 78 | } |
||
| 79 | |||
| 80 | /** |
||
| 81 | * Get all assessments for this Criteria, for all Screening Plans. |
||
| 82 | * |
||
| 83 | * @return \Illuminate\Database\Eloquent\Collection |
||
| 84 | */ |
||
| 85 | public function assessments() // phpcs:ignore |
||
| 88 | } |
||
| 89 | |||
| 90 | /** |
||
| 91 | * Get the translated name of this Criteria's required skill level. |
||
| 92 | * |
||
| 93 | * @return string |
||
|
1 ignored issue
–
show
|
|||
| 94 | */ |
||
| 95 | public function getLevelNameAttribute(): string |
||
| 100 | } |
||
| 101 | |||
| 102 | /** |
||
| 103 | * Get the translated description of this Criteria's required skill level. |
||
| 104 | * |
||
| 105 | * @return string |
||
|
1 ignored issue
–
show
|
|||
| 106 | */ |
||
| 107 | public function getLevelDescriptionAttribute() : string |
||
| 112 | } |
||
| 113 | } |
||
| 114 |