1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Created by Reliese Model. |
5
|
|
|
* Date: Thu, 12 Jul 2018 22:39:27 +0000. |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace App\Models; |
9
|
|
|
|
10
|
|
|
use App\Models\WorkSample; |
11
|
|
|
use Illuminate\Database\Eloquent\Collection; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Class Applicant |
15
|
|
|
* |
16
|
|
|
* @property int $id |
17
|
|
|
* @property string $personal_website |
18
|
|
|
* @property string $tagline |
19
|
|
|
* @property string $twitter_username |
20
|
|
|
* @property string $linkedin_url |
21
|
|
|
* @property int $user_id |
22
|
|
|
* @property boolean $is_snapshot |
23
|
|
|
* |
24
|
|
|
* @property \Jenssegers\Date\Date $created_at |
25
|
|
|
* @property \Jenssegers\Date\Date $updated_at |
26
|
|
|
* |
27
|
|
|
* @property \App\Models\User $user |
28
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $applicant_profile_answers |
29
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $job_applications |
30
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $degrees |
31
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $courses |
32
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $work_experiences |
33
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $skill_declarations |
34
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $references |
35
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $work_samples |
36
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $projects |
37
|
|
|
*/ |
38
|
|
|
class Applicant extends BaseModel |
39
|
|
|
{ |
40
|
|
|
|
41
|
|
|
protected $casts = [ |
|
|
|
|
42
|
|
|
'user_id' => 'int', |
43
|
|
|
'personal_website' => 'string', |
44
|
|
|
'tagline' => 'string', |
45
|
|
|
'twitter_username' => 'string', |
46
|
|
|
'linkedin_url' => 'string', |
47
|
|
|
'is_snapshot' => 'boolean' |
48
|
|
|
]; |
49
|
|
|
protected $fillable = [ |
|
|
|
|
50
|
|
|
'personal_website', |
51
|
|
|
'tagline', |
52
|
|
|
'twitter_username', |
53
|
|
|
'linkedin_url' |
54
|
|
|
]; |
55
|
|
|
|
56
|
25 |
|
public function user() |
|
|
|
|
57
|
|
|
{ |
58
|
25 |
|
return $this->belongsTo(\App\Models\User::class); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
public function applicant_profile_answers() |
|
|
|
|
62
|
|
|
{ |
63
|
|
|
return $this->hasMany(\App\Models\ApplicantProfileAnswer::class); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function job_applications() |
|
|
|
|
67
|
|
|
{ |
68
|
|
|
if ($this->is_snapshot) { |
69
|
|
|
return $this->hasMany(\App\Models\JobApplication::class, 'applicant_snapshot_id'); |
70
|
|
|
} |
71
|
|
|
return $this->hasMany(\App\Models\JobApplication::class); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
public function degrees() |
|
|
|
|
75
|
|
|
{ |
76
|
|
|
return $this->hasMany(\App\Models\Degree::class)->orderBy('end_date', 'desc'); |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
public function courses() |
|
|
|
|
80
|
|
|
{ |
81
|
|
|
return $this->hasMany(\App\Models\Course::class)->orderBy('end_date', 'desc'); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
public function work_experiences() |
|
|
|
|
85
|
|
|
{ |
86
|
|
|
return $this->hasMany(\App\Models\WorkExperience::class)->orderBy('end_date', 'desc'); |
87
|
|
|
} |
88
|
|
|
|
89
|
2 |
|
public function skill_declarations() |
|
|
|
|
90
|
|
|
{ |
91
|
2 |
|
return $this->hasMany(\App\Models\SkillDeclaration::class); |
92
|
|
|
} |
93
|
|
|
|
94
|
1 |
|
public function references() |
|
|
|
|
95
|
|
|
{ |
96
|
1 |
|
return $this->hasMany(\App\Models\Reference::class); |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
public function work_samples() |
|
|
|
|
100
|
|
|
{ |
101
|
|
|
return $this->hasMany(\App\Models\WorkSample::class); |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
public function projects() |
|
|
|
|
105
|
|
|
{ |
106
|
|
|
return $this->hasMany(\App\Models\Project::class); |
107
|
|
|
} |
108
|
|
|
} |
109
|
|
|
|