Passed
Push — feature/screen-candidates-emai... ( 9d78fe...325fca )
by Yonathan
04:46
created

ExperienceAward::experience_skills()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Models;
4
5
use App\Models\BaseModel;
6
7
/**
8
 * Class ExperienceAward
9
 *
10
 * @property int $id
11
 * @property string $title
12
 * @property int $award_recipient_type_id
13
 * @property string $issued_by
14
 * @property int $award_recognition_type_id
15
 * @property \Jenssegers\Date\Date $awarded_date
16
 * @property int $experienceable_id
17
 * @property string $experienceable_type
18
 * @property boolean $is_education_requirement
19
 * @property \Jenssegers\Date\Date $created_at
20
 * @property \Jenssegers\Date\Date $updated_at
21
 *
22
 * @property \App\Models\Applicant|\App\Models\JobApplication $experienceable
23
 * @property \Illuminate\Database\Eloquent\Collection $skills
24
 * @property \Illuminate\Database\Eloquent\Collection $experience_skills
25
 */
26
class ExperienceAward extends BaseModel
27
{
28
    protected $casts = [
29
        'title' => 'string',
30
        'award_recipient_type_id' => 'int',
31
        'issued_by' => 'string',
32
        'award_recognition_type_id' => 'int',
33
        'awarded_date' => 'date',
34
        'is_education_requirement' => 'boolean'
35
    ];
36
37
    protected $fillable = [
38
        'title',
39
        'award_recipient_type_id',
40
        'issued_by',
41
        'award_recognition_type_id',
42
        'awarded_date',
43
        'is_education_requirement'
44
    ];
45
46
    protected $table = 'experiences_award';
47
48
    public function award_recipient_type() //phpcs:ignore
49
    {
50
        return $this->belongsTo(\App\Models\Lookup\AwardRecipientType::class);
51
    }
52
53
    public function award_recognition_type() //phpcs:ignore
54
    {
55
        return $this->belongsTo(\App\Models\Lookup\AwardRecognitionType::class);
56
    }
57
58
    public function experienceable() //phpcs:ignore
59
    {
60
        return $this->morphTo();
61
    }
62
63
    public function skills()
64
    {
65
        return $this->morphToMany(\App\Models\Skill::class, 'experience', 'experience_skills');
66
    }
67
68
    public function experience_skills() //phpcs:ignore
69
    {
70
        return $this->morphMany(\App\Models\ExperienceSkill::class, 'experience');
71
    }
72
}
73