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

ExperiencePersonal::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 ExperiencePersonal
9
 *
10
 * @property int $id
11
 * @property string $title
12
 * @property string $description
13
 * @property boolean $is_shareable
14
 * @property boolean $is_active
15
 * @property \Jenssegers\Date\Date $start_date
16
 * @property \Jenssegers\Date\Date $end_date
17
 * @property int $experienceable_id
18
 * @property string $experienceable_type
19
 * @property boolean $is_education_requirement
20
 * @property \Jenssegers\Date\Date $created_at
21
 * @property \Jenssegers\Date\Date $updated_at
22
 *
23
 * @property \App\Models\Applicant|\App\Models\JobApplication $experienceable
24
 * @property \Illuminate\Database\Eloquent\Collection $skills
25
 * @property \Illuminate\Database\Eloquent\Collection $experience_skills
26
 */
27
class ExperiencePersonal extends BaseModel
28
{
29
    protected $casts = [
30
        'title' => 'string',
31
        'description' => 'string',
32
        'is_shareable' => 'boolean',
33
        'is_active' => 'boolean',
34
        'start_date' => 'date',
35
        'end_date' => 'date',
36
        'is_education_requirement' => 'boolean'
37
    ];
38
39
    protected $fillable = [
40
        'title',
41
        'description',
42
        'is_shareable',
43
        'is_active',
44
        'start_date',
45
        'end_date',
46
        'is_education_requirement'
47
    ];
48
49
    protected $table = 'experiences_personal';
50
51
    public function experienceable() //phpcs:ignore
52
    {
53
        return $this->morphTo();
54
    }
55
56
    public function skills()
57
    {
58
        return $this->morphToMany(\App\Models\Skill::class, 'experience', 'experience_skills');
59
    }
60
61
    public function experience_skills() //phpcs:ignore
62
    {
63
        return $this->morphMany(\App\Models\ExperienceSkill::class, 'experience');
64
    }
65
}
66