@@ -36,7 +36,8 @@ |
||
36 | 36 | */ |
37 | 37 | public function setCriterionIdAttribute($value): void |
38 | 38 | { |
39 | - if (empty($value)) { // will check for empty string, null values |
|
39 | + if (empty($value)) { |
|
40 | +// will check for empty string, null values |
|
40 | 41 | $this->attributes['criterion_id'] = null; |
41 | 42 | } else { |
42 | 43 | $this->attributes['criterion_id'] = $value; |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | /** |
176 | - * Check if the user has the specified role. |
|
177 | - * @param string $role This may be either 'applicant', 'manager' or 'admin'. |
|
178 | - * @return boolean |
|
179 | - */ |
|
176 | + * Check if the user has the specified role. |
|
177 | + * @param string $role This may be either 'applicant', 'manager' or 'admin'. |
|
178 | + * @return boolean |
|
179 | + */ |
|
180 | 180 | public function hasRole($role) |
181 | 181 | { |
182 | 182 | switch ($role) { |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | * Set this user to the specified role. |
196 | 196 | * |
197 | 197 | * @param string $role Must be either 'applicant', 'manager' or 'admin. |
198 | - * @return void |
|
199 | - */ |
|
198 | + * @return void |
|
199 | + */ |
|
200 | 200 | public function setRole(string $role): void |
201 | 201 | { |
202 | 202 | $this->user_role()->associate(UserRole::where('name', $role)->firstOrFail()); |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * Returns a user's full name. |
232 | 232 | * |
233 | 233 | * @return string |
234 | - */ |
|
234 | + */ |
|
235 | 235 | public function getFullNameAttribute(): string |
236 | 236 | { |
237 | 237 | return $this->first_name . ' ' . $this->last_name; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @property \App\Models\Applicant $applicant |
21 | 21 | * @property \App\Models\Lookup\ApplicantProfileQuestion $applicant_profile_question |
22 | 22 | */ |
23 | -class ApplicantProfileAnswer extends BaseModel { |
|
23 | +class ApplicantProfileAnswer extends BaseModel{ |
|
24 | 24 | |
25 | 25 | protected $casts = [ |
26 | 26 | 'applicant_id' => 'int', |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | 'applicant_profile_question' |
35 | 35 | ]; |
36 | 36 | |
37 | - public function applicant() { |
|
37 | + public function applicant(){ |
|
38 | 38 | return $this->belongsTo(\App\Models\Applicant::class); |
39 | 39 | } |
40 | 40 | |
41 | - public function applicant_profile_question() { |
|
41 | + public function applicant_profile_question(){ |
|
42 | 42 | return $this->belongsTo(\App\Models\Lookup\ApplicantProfileQuestion::class); |
43 | 43 | } |
44 | 44 |
@@ -20,7 +20,8 @@ discard block |
||
20 | 20 | * @property \App\Models\Applicant $applicant |
21 | 21 | * @property \App\Models\Lookup\ApplicantProfileQuestion $applicant_profile_question |
22 | 22 | */ |
23 | -class ApplicantProfileAnswer extends BaseModel { |
|
23 | +class ApplicantProfileAnswer extends BaseModel |
|
24 | +{ |
|
24 | 25 | |
25 | 26 | protected $casts = [ |
26 | 27 | 'applicant_id' => 'int', |
@@ -34,11 +35,13 @@ discard block |
||
34 | 35 | 'applicant_profile_question' |
35 | 36 | ]; |
36 | 37 | |
37 | - public function applicant() { |
|
38 | + public function applicant() |
|
39 | + { |
|
38 | 40 | return $this->belongsTo(\App\Models\Applicant::class); |
39 | 41 | } |
40 | 42 | |
41 | - public function applicant_profile_question() { |
|
43 | + public function applicant_profile_question() |
|
44 | + { |
|
42 | 45 | return $this->belongsTo(\App\Models\Lookup\ApplicantProfileQuestion::class); |
43 | 46 | } |
44 | 47 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @property \App\Models\WorkEnvironment $work_environment |
22 | 22 | * @property \App\Models\WorkplacePhoto $workplace_photo |
23 | 23 | */ |
24 | -class WorkplacePhotoCaption extends BaseModel { |
|
24 | +class WorkplacePhotoCaption extends BaseModel{ |
|
25 | 25 | |
26 | 26 | protected $casts = [ |
27 | 27 | 'work_environment_id' => 'int', |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | 'description' |
33 | 33 | ]; |
34 | 34 | |
35 | - public function work_environment() { |
|
35 | + public function work_environment(){ |
|
36 | 36 | return $this->belongsTo(\App\Models\WorkEnvironment::class); |
37 | 37 | } |
38 | 38 | |
39 | - public function workplace_photo() { |
|
39 | + public function workplace_photo(){ |
|
40 | 40 | return $this->belongsTo(\App\Models\WorkplacePhoto::class); |
41 | 41 | } |
42 | 42 |
@@ -21,7 +21,8 @@ discard block |
||
21 | 21 | * @property \App\Models\WorkEnvironment $work_environment |
22 | 22 | * @property \App\Models\WorkplacePhoto $workplace_photo |
23 | 23 | */ |
24 | -class WorkplacePhotoCaption extends BaseModel { |
|
24 | +class WorkplacePhotoCaption extends BaseModel |
|
25 | +{ |
|
25 | 26 | |
26 | 27 | protected $casts = [ |
27 | 28 | 'work_environment_id' => 'int', |
@@ -32,11 +33,13 @@ discard block |
||
32 | 33 | 'description' |
33 | 34 | ]; |
34 | 35 | |
35 | - public function work_environment() { |
|
36 | + public function work_environment() |
|
37 | + { |
|
36 | 38 | return $this->belongsTo(\App\Models\WorkEnvironment::class); |
37 | 39 | } |
38 | 40 | |
39 | - public function workplace_photo() { |
|
41 | + public function workplace_photo() |
|
42 | + { |
|
40 | 43 | return $this->belongsTo(\App\Models\WorkplacePhoto::class); |
41 | 44 | } |
42 | 45 |
@@ -37,15 +37,15 @@ |
||
37 | 37 | */ |
38 | 38 | protected $with = ['review_status']; |
39 | 39 | |
40 | - public function job_application() { |
|
40 | + public function job_application(){ |
|
41 | 41 | return $this->belongsTo(JobApplication::class); |
42 | 42 | } |
43 | 43 | |
44 | - public function review_status() { |
|
44 | + public function review_status(){ |
|
45 | 45 | return $this->belongsTo(ReviewStatus::class); |
46 | 46 | } |
47 | 47 | |
48 | - public function getStatusAttribute() { |
|
48 | + public function getStatusAttribute(){ |
|
49 | 49 | return $this->review_status->translation; |
50 | 50 | } |
51 | 51 | } |
@@ -37,15 +37,18 @@ |
||
37 | 37 | */ |
38 | 38 | protected $with = ['review_status']; |
39 | 39 | |
40 | - public function job_application() { |
|
40 | + public function job_application() |
|
41 | + { |
|
41 | 42 | return $this->belongsTo(JobApplication::class); |
42 | 43 | } |
43 | 44 | |
44 | - public function review_status() { |
|
45 | + public function review_status() |
|
46 | + { |
|
45 | 47 | return $this->belongsTo(ReviewStatus::class); |
46 | 48 | } |
47 | 49 | |
48 | - public function getStatusAttribute() { |
|
50 | + public function getStatusAttribute() |
|
51 | + { |
|
49 | 52 | return $this->review_status->translation; |
50 | 53 | } |
51 | 54 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @property \App\Models\JobApplication $job_application |
21 | 21 | * @property \App\Models\JobPosterQuestion $job_poster_question |
22 | 22 | */ |
23 | -class JobApplicationAnswer extends BaseModel { |
|
23 | +class JobApplicationAnswer extends BaseModel{ |
|
24 | 24 | |
25 | 25 | protected $casts = [ |
26 | 26 | 'job_poster_questions_id' => 'int', |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | 'answer' |
31 | 31 | ]; |
32 | 32 | |
33 | - public function job_application() { |
|
33 | + public function job_application(){ |
|
34 | 34 | return $this->belongsTo(\App\Models\JobApplication::class); |
35 | 35 | } |
36 | 36 | |
37 | - public function job_poster_question() { |
|
37 | + public function job_poster_question(){ |
|
38 | 38 | return $this->belongsTo(\App\Models\JobPosterQuestion::class); |
39 | 39 | } |
40 | 40 |
@@ -20,7 +20,8 @@ discard block |
||
20 | 20 | * @property \App\Models\JobApplication $job_application |
21 | 21 | * @property \App\Models\JobPosterQuestion $job_poster_question |
22 | 22 | */ |
23 | -class JobApplicationAnswer extends BaseModel { |
|
23 | +class JobApplicationAnswer extends BaseModel |
|
24 | +{ |
|
24 | 25 | |
25 | 26 | protected $casts = [ |
26 | 27 | 'job_poster_questions_id' => 'int', |
@@ -30,11 +31,13 @@ discard block |
||
30 | 31 | 'answer' |
31 | 32 | ]; |
32 | 33 | |
33 | - public function job_application() { |
|
34 | + public function job_application() |
|
35 | + { |
|
34 | 36 | return $this->belongsTo(\App\Models\JobApplication::class); |
35 | 37 | } |
36 | 38 | |
37 | - public function job_poster_question() { |
|
39 | + public function job_poster_question() |
|
40 | + { |
|
38 | 41 | return $this->belongsTo(\App\Models\JobPosterQuestion::class); |
39 | 42 | } |
40 | 43 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @property \App\Models\Lookup\CourseStatus $course_status |
26 | 26 | * @property \App\Models\Applicant $applicant |
27 | 27 | */ |
28 | -class Course extends BaseModel { |
|
28 | +class Course extends BaseModel{ |
|
29 | 29 | |
30 | 30 | protected $casts = [ |
31 | 31 | 'name' => 'string', |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | 'end_date' |
44 | 44 | ]; |
45 | 45 | |
46 | - public function course_status() { |
|
46 | + public function course_status(){ |
|
47 | 47 | return $this->belongsTo(\App\Models\Lookup\CourseStatus::class); |
48 | 48 | } |
49 | 49 | |
50 | - public function applicant() { |
|
50 | + public function applicant(){ |
|
51 | 51 | return $this->belongsTo(\App\Models\Applicant::class); |
52 | 52 | } |
53 | 53 | } |
@@ -25,7 +25,8 @@ discard block |
||
25 | 25 | * @property \App\Models\Lookup\CourseStatus $course_status |
26 | 26 | * @property \App\Models\Applicant $applicant |
27 | 27 | */ |
28 | -class Course extends BaseModel { |
|
28 | +class Course extends BaseModel |
|
29 | +{ |
|
29 | 30 | |
30 | 31 | protected $casts = [ |
31 | 32 | 'name' => 'string', |
@@ -43,11 +44,13 @@ discard block |
||
43 | 44 | 'end_date' |
44 | 45 | ]; |
45 | 46 | |
46 | - public function course_status() { |
|
47 | + public function course_status() |
|
48 | + { |
|
47 | 49 | return $this->belongsTo(\App\Models\Lookup\CourseStatus::class); |
48 | 50 | } |
49 | 51 | |
50 | - public function applicant() { |
|
52 | + public function applicant() |
|
53 | + { |
|
51 | 54 | return $this->belongsTo(\App\Models\Applicant::class); |
52 | 55 | } |
53 | 56 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | use Jenssegers\Date\Date; |
10 | 10 | use DateTime; |
11 | 11 | |
12 | -abstract class BaseModel extends Eloquent { |
|
12 | +abstract class BaseModel extends Eloquent{ |
|
13 | 13 | //Override date functions to return Jenssegers Data instead of Carbon |
14 | 14 | |
15 | 15 | /** |
@@ -9,7 +9,8 @@ |
||
9 | 9 | use Jenssegers\Date\Date; |
10 | 10 | use DateTime; |
11 | 11 | |
12 | -abstract class BaseModel extends Eloquent { |
|
12 | +abstract class BaseModel extends Eloquent |
|
13 | +{ |
|
13 | 14 | //Override date functions to return Jenssegers Data instead of Carbon |
14 | 15 | |
15 | 16 | /** |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @property \Illuminate\Database\Eloquent\Collection $references |
23 | 23 | */ |
24 | -class Project extends BaseModel { |
|
24 | +class Project extends BaseModel{ |
|
25 | 25 | |
26 | 26 | protected $casts = [ |
27 | 27 | 'name' => 'string', |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | 'end_date' |
36 | 36 | ]; |
37 | 37 | |
38 | - public function references() { |
|
38 | + public function references(){ |
|
39 | 39 | return $this->belongsToMany(\App\Models\Reference::class); |
40 | 40 | } |
41 | 41 | |
42 | - public function applicant() { |
|
42 | + public function applicant(){ |
|
43 | 43 | return $this->belongsTo(\App\Models\Applicant::class); |
44 | 44 | } |
45 | 45 | } |
@@ -21,7 +21,8 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @property \Illuminate\Database\Eloquent\Collection $references |
23 | 23 | */ |
24 | -class Project extends BaseModel { |
|
24 | +class Project extends BaseModel |
|
25 | +{ |
|
25 | 26 | |
26 | 27 | protected $casts = [ |
27 | 28 | 'name' => 'string', |
@@ -35,11 +36,13 @@ discard block |
||
35 | 36 | 'end_date' |
36 | 37 | ]; |
37 | 38 | |
38 | - public function references() { |
|
39 | + public function references() |
|
40 | + { |
|
39 | 41 | return $this->belongsToMany(\App\Models\Reference::class); |
40 | 42 | } |
41 | 43 | |
42 | - public function applicant() { |
|
44 | + public function applicant() |
|
45 | + { |
|
43 | 46 | return $this->belongsTo(\App\Models\Applicant::class); |
44 | 47 | } |
45 | 48 | } |