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

ExperienceAwards   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
eloc 17
c 1
b 0
f 1
dl 0
loc 36
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A job_applications() 0 3 1
A awards_experienceable() 0 3 1
A award_recipient_type() 0 3 1
A award_recognition_type() 0 3 1
1
<?php
2
3
namespace App\Models;
4
5
use App\Models\BaseModel;
6
7
/**
8
 * Class ExperienceAwards
9
 *
10
 * @property int $id
11
 * @property string $title
12
 * @property int $recipient_type_id
13
 * @property string $issued_by
14
 * @property int $recognition_type_id
15
 * @property \Jenssegers\Date\Date $awarded_date
16
 * @property int $awards_experienceable_id
17
 * @property string $awards_experienceable_type
18
 * @property \Jenssegers\Date\Date $created_at
19
 * @property \Jenssegers\Date\Date $updated_at
20
 *
21
 * @property \Illuminate\Database\Eloquent\Collection $job_applications
22
 * @property \App\Models\Applicant|\App\Models\JobApplication $awards_experienceable
23
 */
24
class ExperienceAwards extends BaseModel
25
{
26
    protected $casts = [
27
        'title' => 'string',
28
        'recipient_type_id' => 'int',
29
        'issued_by' => 'string',
30
        'recognition_type_id' => 'int',
31
        'awarded_date' => 'date'
32
    ];
33
34
    protected $fillable = [
35
        'title',
36
        'recipient_type_id',
37
        'issued_by',
38
        'recognition_type_id',
39
        'awarded_date'
40
    ];
41
42
    public function award_recipient_type() //phpcs:ignore
43
    {
44
        return $this->belongsTo(\App\Models\Lookup\AwardRecipientType::class);
45
    }
46
47
    public function award_recognition_type() //phpcs:ignore
48
    {
49
        return $this->belongsTo(\App\Models\Lookup\AwardRecognitionType::class);
50
    }
51
52
    public function job_applications() //phpcs:ignore
53
    {
54
        return $this->belongsToMany(\App\Models\JobApplication::class);
55
    }
56
57
    public function awards_experienceable() //phpcs:ignore
58
    {
59
        return $this->morphTo();
60
    }
61
}
62