Passed
Push — feature/response-screening ( cb2647...2d8034 )
by Chris
03:58
created

ApplicationReview::job_application()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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 $fillable = [
32
        'review_status_id',
33
        'department_id',
34
        'notes',
35
    ];
36
37
    /**
38
     * The accessors to append to the model's array form.
39
     *
40
     * @var array
41
     */
42
    protected $with = ['review_status'];
43
44
    public function job_application()
45
    {
46
        return $this->belongsTo(JobApplication::class);
47
    }
48
49
    public function review_status()
50
    {
51
        return $this->belongsTo(ReviewStatus::class);
52
    }
53
54
    public function department()
55
    {
56
        return $this->belongsTo(Department::class);
57
    }
58
59
    public function getStatusAttribute()
60
    {
61
        return $this->review_status->translation;
62
    }
63
}
64