Passed
Push — task/experience-education ( 788037 )
by Grant
05:48
created

ExperienceEducation   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
eloc 27
c 1
b 0
f 1
dl 0
loc 43
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A education_status() 0 3 1
A experienceable() 0 3 1
A education_type() 0 3 1
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 $education_status_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 $experienceable_id
21
 * @property string $experienceable_type
22
 * @property boolean $is_education_requirement
23
 * @property \Jenssegers\Date\Date $created_at
24
 * @property \Jenssegers\Date\Date $updated_at
25
 *
26
 * @property \App\Models\Lookup\EducationType $education_type
27
 * @property \App\Models\Lookup\EducationStatus $education_status
28
 * @property \App\Models\Applicant|\App\Models\JobApplication $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
        'education_status_id' => 'int',
37
        'is_active' => 'boolean',
38
        'start_date' => 'date',
39
        'end_date' => 'date',
40
        'thesis_title' => 'string',
41
        'has_blockcert' => 'boolean',
42
        'is_education_requirement' => 'boolean'
43
    ];
44
45
    protected $fillable = [
46
        'education_type_id',
47
        'area_of_study',
48
        'institution',
49
        'education_status_id',
50
        'is_active',
51
        'start_date',
52
        'end_date',
53
        'thesis_title',
54
        'has_blockcert',
55
        'is_education_requirement'
56
    ];
57
58
    protected $table = ['experiences_education'];
59
60
    public function education_type() //phpcs:ignore
61
    {
62
        return $this->belongsTo(\App\Models\Lookup\EducationType::class);
63
    }
64
65
    public function education_status() //phpcs:ignore
66
    {
67
        return $this->belongsTo(\App\Models\Lookup\EducationStatus::class);
68
    }
69
70
    public function experienceable() //phpcs:ignore
71
    {
72
        return $this->morphTo();
73
    }
74
}
75