1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Models; |
4
|
|
|
|
5
|
|
|
use App\Models\BaseModel; |
6
|
|
|
use Spatie\Translatable\HasTranslations; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class WorkEnvironment |
10
|
|
|
* |
11
|
|
|
* @property int $id |
12
|
|
|
* @property int $manager_id |
13
|
|
|
* @property int $telework_allowed_frequency_id |
14
|
|
|
* @property int $flexible_hours_frequency_id |
15
|
|
|
* @property \Jenssegers\Date\Date $created_at |
16
|
|
|
* @property \Jenssegers\Date\Date $updated_at |
17
|
|
|
* |
18
|
|
|
* @property \App\Models\Manager $manager |
19
|
|
|
* @property \App\Models\Lookup\Frequency $telework_allowed_frequency |
20
|
|
|
* @property \App\Models\Lookup\Frequency $flexible_hours_frequency |
21
|
|
|
* @property \Illuminate\Database\Eloquent\Collection $workplace_photo_captions |
22
|
|
|
* |
23
|
|
|
* Localized Properties: |
24
|
|
|
* @property string $things_to_know |
25
|
|
|
*/ |
26
|
|
|
class WorkEnvironment extends BaseModel |
27
|
|
|
{ |
28
|
|
|
use HasTranslations; |
29
|
|
|
|
30
|
|
|
public $translatable = ['things_to_know']; |
|
|
|
|
31
|
|
|
protected $casts = [ |
|
|
|
|
32
|
|
|
'telework_allowed_frequency_id' => 'int', |
33
|
|
|
'flexible_hours_frequency_id' => 'int', |
34
|
|
|
]; |
35
|
|
|
protected $fillable = [ |
|
|
|
|
36
|
|
|
'telework_allowed_frequency_id', |
37
|
|
|
'flexible_hours_frequency_id' |
38
|
|
|
]; |
39
|
|
|
protected $with = [ |
|
|
|
|
40
|
|
|
'telework_allowed_frequency', |
41
|
|
|
'flexible_hours_frequency' |
42
|
|
|
]; |
43
|
|
|
|
44
|
|
|
public function manager() |
|
|
|
|
45
|
|
|
{ |
46
|
|
|
return $this->belongsTo(\App\Models\Manager::class); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public function telework_allowed_frequency() //phpcs:ignore |
50
|
|
|
{ |
51
|
|
|
return $this->belongsTo(\App\Models\Lookup\Frequency::class); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function flexible_hours_frequency() //phpcs:ignore |
55
|
|
|
{ |
56
|
|
|
return $this->belongsTo(\App\Models\Lookup\Frequency::class); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function workplace_photo_captions() //phpcs:ignore |
60
|
|
|
{ |
61
|
|
|
return $this->hasMany(\App\Models\WorkplacePhotoCaption::class); |
62
|
|
|
} |
63
|
|
|
} |
64
|
|
|
|