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

ApplicationReview   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 10
dl 0
loc 33
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A job_application() 0 3 1
A review_status() 0 3 1
A department() 0 3 1
A getStatusAttribute() 0 3 1
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