Passed
Push — task/experience-models ( f8cac9...6cc85a )
by Grant
17:57
created

ExperienceEducation::job_applications()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
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 ExperienceEducation
9
 *
10
 * @property int $id
11
 * @property int $education_type_id
12
 * @property string $area_of_study
13
 * @property string $institution
14
 * @property int $status_type_id
15
 * @property boolean $is_active
16
 * @property \Jenssegers\Date\Date $start_date
17
 * @property \Jenssegers\Date\Date $end_date
18
 * @property string $thesis_title
19
 * @property boolean $has_blockcert
20
 * @property int $education_experienceable_id
21
 * @property string $education_experienceable_type
22
 * @property \Jenssegers\Date\Date $created_at
23
 * @property \Jenssegers\Date\Date $updated_at
24
 *
25
 * @property \App\Models\Lookup\ExperienceEducationType $experience_education_type
26
 * @property \App\Models\Lookup\ExperienceEducationStatus $experience_education_status
27
 * @property \Illuminate\Database\Eloquent\Collection $job_applications
28
 * @property \App\Models\Applicant|\App\Models\JobApplication $education_experienceable
29
 */
30
class ExperienceEducation extends BaseModel
31
{
32
    protected $casts = [
33
        'education_type_id' => 'int',
34
        'area_of_study' => 'string',
35
        'institution' => 'string',
36
        'status_type_id' => 'int',
37
        'is_active' => 'boolean',
38
        'start_date' => 'date',
39
        'end_date' => 'date',
40
        'thesis_title' => 'string',
41
        'has_blockcert' => 'boolean'
42
    ];
43
44
    protected $fillable = [
45
        'education_type_id',
46
        'area_of_study',
47
        'institution',
48
        'status_type_id',
49
        'is_active',
50
        'start_date',
51
        'end_date',
52
        'thesis_title',
53
        'has_blockcert'
54
    ];
55
56
    public function education_type() //phpcs:ignore
57
    {
58
        return $this->belongsTo(\App\Models\Lookup\EducationType::class);
59
    }
60
61
    public function education_status() //phpcs:ignore
62
    {
63
        return $this->belongsTo(\App\Models\Lookup\EducationStatus::class);
64
    }
65
66
    public function job_applications() //phpcs:ignore
67
    {
68
        return $this->belongsToMany(\App\Models\JobApplication::class);
69
    }
70
71
    public function education_experienceable() //phpcs:ignore
72
    {
73
        return $this->morphTo();
74
    }
75
}
76