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 boolean $director_email_sent |
20
|
|
|
* @property boolean $reference _email_sent |
21
|
|
|
* @property \Jenssegers\Date\Date $created_at |
22
|
|
|
* @property \Jenssegers\Date\Date $updated_at |
23
|
|
|
* |
24
|
|
|
* @property \App\Models\JobApplication $job_application |
25
|
|
|
* @property \App\Models\Lookup\Department $department |
26
|
|
|
* @property \App\Models\Lookup\ReviewStatus $review_status |
27
|
|
|
* |
28
|
|
|
* Accessors: |
29
|
|
|
* @property string $status |
30
|
|
|
**/ |
31
|
|
|
class ApplicationReview extends Model |
32
|
|
|
{ |
33
|
|
|
protected $casts = [ |
34
|
|
|
'job_application_id' => 'int', |
35
|
|
|
'review_status_id' => 'int', |
36
|
|
|
'department_id' => 'int', |
37
|
|
|
'notes' => 'string', |
38
|
|
|
'director_email_sent' => 'boolean', |
39
|
|
|
'reference_email_sent' => 'boolean', |
40
|
|
|
]; |
41
|
|
|
|
42
|
|
|
protected $fillable = [ |
43
|
|
|
'review_status_id', |
44
|
|
|
'department_id', |
45
|
|
|
'notes', |
46
|
|
|
]; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* The accessors to append to the model's array form. |
50
|
|
|
* |
51
|
|
|
* @var array |
52
|
|
|
*/ |
53
|
|
|
protected $with = ['review_status']; |
54
|
|
|
|
55
|
|
|
public function job_application() |
56
|
|
|
{ |
57
|
|
|
return $this->belongsTo(JobApplication::class); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function review_status() |
61
|
|
|
{ |
62
|
|
|
return $this->belongsTo(ReviewStatus::class); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function department() |
66
|
|
|
{ |
67
|
|
|
return $this->belongsTo(Department::class); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
public function getStatusAttribute() |
71
|
|
|
{ |
72
|
|
|
return $this->review_status->translation; |
73
|
|
|
} |
74
|
|
|
} |
75
|
|
|
|