Passed
Push — dev ( 2cea8b...7299be )
by Tristan
04:19
created

ApplicationReview::department()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use App\Models\JobApplication;
7
use App\Models\Lookup\Department;
8
use App\Models\Lookup\ReviewStatus;
9
use App\Models\Lookup\ReviewDecision;
10
11
/**
12
 * Class AppliationReview
13
 *
14
 * @property int $id
15
 * @property int $job_application_id
16
 * @property int $review_status_id
17
 * @property int $department_id
18
 * @property string $notes
19
 * @property \Jenssegers\Date\Date $created_at
20
 * @property \Jenssegers\Date\Date $updated_at
21
 *
22
 * @property \App\Models\JobApplication $job_application
23
 * @property \App\Models\Lookup\Department $department
24
 * @property \App\Models\Lookup\ReviewStatus $review_status
25
 *
26
 * Accessors:
27
 * @property string $status
28
 **/
29
class ApplicationReview extends Model
30
{
31
    protected $casts = [
32
        'job_application_id' => 'int',
33
        'review_status_id' => 'int',
34
        'department_id' => 'int',
35
        'notes' => 'string',
36
    ];
37
38
    protected $fillable = [
39
        'review_status_id',
40
        'department_id',
41
        'notes',
42
    ];
43
44
    /**
45
     * The accessors to append to the model's array form.
46
     *
47
     * @var array
48
     */
49
    protected $with = ['review_status'];
50
51
    public function job_application()
52
    {
53
        return $this->belongsTo(JobApplication::class);
54
    }
55
56
    public function review_status()
57
    {
58
        return $this->belongsTo(ReviewStatus::class);
59
    }
60
61
    public function department()
62
    {
63
        return $this->belongsTo(Department::class);
64
    }
65
66
    public function getStatusAttribute()
67
    {
68
        return $this->review_status->translation;
69
    }
70
}
71