1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Models; |
4
|
|
|
|
5
|
|
|
use App\Models\BaseModel; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class ExperienceAward |
9
|
|
|
* |
10
|
|
|
* @property int $id |
11
|
|
|
* @property string $title |
12
|
|
|
* @property int $award_recipient_type_id |
13
|
|
|
* @property string $issued_by |
14
|
|
|
* @property int $award_recognition_type_id |
15
|
|
|
* @property \Jenssegers\Date\Date $awarded_date |
16
|
|
|
* @property int $experienceable_id |
17
|
|
|
* @property string $experienceable_type |
18
|
|
|
* @property \Jenssegers\Date\Date $created_at |
19
|
|
|
* @property \Jenssegers\Date\Date $updated_at |
20
|
|
|
* |
21
|
|
|
* @property \App\Models\Applicant|\App\Models\JobApplication $experienceable |
22
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $skills |
23
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $experience_skills |
24
|
|
|
*/ |
25
|
|
|
class ExperienceAward extends BaseModel |
26
|
|
|
{ |
27
|
|
|
protected $casts = [ |
28
|
|
|
'title' => 'string', |
29
|
|
|
'award_recipient_type_id' => 'int', |
30
|
|
|
'issued_by' => 'string', |
31
|
|
|
'award_recognition_type_id' => 'int', |
32
|
|
|
'awarded_date' => 'date' |
33
|
|
|
]; |
34
|
|
|
|
35
|
|
|
protected $fillable = [ |
36
|
|
|
'title', |
37
|
|
|
'award_recipient_type_id', |
38
|
|
|
'issued_by', |
39
|
|
|
'award_recognition_type_id', |
40
|
|
|
'awarded_date' |
41
|
|
|
]; |
42
|
|
|
|
43
|
|
|
protected $table = 'experiences_award'; |
44
|
|
|
|
45
|
|
|
public function award_recipient_type() //phpcs:ignore |
46
|
|
|
{ |
47
|
|
|
return $this->belongsTo(\App\Models\Lookup\AwardRecipientType::class); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function award_recognition_type() //phpcs:ignore |
51
|
|
|
{ |
52
|
|
|
return $this->belongsTo(\App\Models\Lookup\AwardRecognitionType::class); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function experienceable() //phpcs:ignore |
56
|
|
|
{ |
57
|
|
|
return $this->morphTo(); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function skills() |
61
|
|
|
{ |
62
|
|
|
return $this->morphToMany(\App\Models\Skill::class, 'experience', 'experience_skills'); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function experience_skills() //phpcs:ignore |
66
|
|
|
{ |
67
|
|
|
return $this->morphMany(\App\Models\ExperienceSkill::class, 'experience'); |
68
|
|
|
} |
69
|
|
|
} |
70
|
|
|
|