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
|
|
|
/** |
11
|
|
|
* Class Criteria |
12
|
|
|
* |
13
|
|
|
* @property int $id |
14
|
|
|
* @property int $criteria_type_id |
15
|
|
|
* @property int $job_poster_id |
16
|
|
|
* @property \Jenssegers\Date\Date $created_at |
17
|
|
|
* @property \Jenssegers\Date\Date $updated_at |
18
|
|
|
* |
19
|
|
|
* @property \App\Models\Lookup\CriteriaType $criteria_type |
20
|
|
|
* @property \App\Models\JobPoster $job_poster |
21
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $application_work_samples |
22
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $criteria_translations |
23
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $skill_declarations |
24
|
|
|
* |
25
|
|
|
* Localized properties |
26
|
|
|
* @property string $name |
27
|
|
|
* @property string $description |
28
|
|
|
*/ |
|
|
|
|
29
|
|
|
class Criteria extends BaseModel { |
|
|
|
|
30
|
|
|
|
31
|
|
|
use \Dimsav\Translatable\Translatable; |
|
|
|
|
32
|
|
|
|
33
|
|
|
protected $table = 'criteria'; |
34
|
|
|
public $translatedAttributes = ['name', 'description']; |
35
|
|
|
protected $casts = [ |
36
|
|
|
'criteria_type_id' => 'int', |
37
|
|
|
'job_poster_id' => 'int' |
38
|
|
|
]; |
39
|
|
|
protected $fillable = [ |
40
|
|
|
'criteria_type_id', |
41
|
|
|
'job_poster_id' |
42
|
|
|
]; |
43
|
|
|
protected $with = [ |
44
|
|
|
'criteria_type' |
45
|
|
|
]; |
46
|
|
|
|
47
|
|
|
public function criteria_type() { |
|
|
|
|
48
|
|
|
return $this->belongsTo(\App\Models\Lookup\CriteriaType::class); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
public function job_poster() { |
|
|
|
|
52
|
|
|
return $this->belongsTo(\App\Models\JobPoster::class); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function application_work_samples() { |
|
|
|
|
56
|
|
|
return $this->hasMany(\App\Models\ApplicationWorkSample::class, 'criteria_id'); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function criteria_translations() { |
|
|
|
|
60
|
|
|
return $this->hasMany(\App\Models\CriteriaTranslation::class, 'criteria_id'); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function skill_declarations() { |
|
|
|
|
64
|
|
|
return $this->hasMany(\App\Models\SkillDeclaration::class, 'criteria_id'); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
} |
68
|
|
|
|