Passed
Push — feature/job-status-notificatio... ( 0278a2...e12c98 )
by Chris
09:02 queued 04:34
created

ExperienceAward::experienceable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
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 \Jenssegers\Date\Date $created_at
19
 * @property \Jenssegers\Date\Date $updated_at
20
 *
21
 * @property \App\Models\Applicant|\App\Models\JobApplication $experienceable
22
 */
23
class ExperienceAward extends BaseModel
24
{
25
    protected $casts = [
26
        'title' => 'string',
27
        'award_recipient_type_id' => 'int',
28
        'issued_by' => 'string',
29
        'award_recognition_type_id' => 'int',
30
        'awarded_date' => 'date'
31
    ];
32
33
    protected $fillable = [
34
        'title',
35
        'award_recipient_type_id',
36
        'issued_by',
37
        'award_recognition_type_id',
38
        'awarded_date'
39
    ];
40
41
    protected $table = 'experiences_award';
42
43
    public function award_recipient_type() //phpcs:ignore
44
    {
45
        return $this->belongsTo(\App\Models\Lookup\AwardRecipientType::class);
46
    }
47
48
    public function award_recognition_type() //phpcs:ignore
49
    {
50
        return $this->belongsTo(\App\Models\Lookup\AwardRecognitionType::class);
51
    }
52
53
    public function experienceable() //phpcs:ignore
54
    {
55
        return $this->morphTo();
56
    }
57
}
58