Passed
Push — task/activity-feed-applicants-... ( 526f6c...c3441a )
by Yonathan
05:02 queued 33s
created

WorkEnvironment::work_environment_translations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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
        'things_to_know'
39
    ];
40
    protected $with = [
41
        'telework_allowed_frequency',
42
        'flexible_hours_frequency'
43
    ];
44
45
    public function manager()
46
    {
47
        return $this->belongsTo(\App\Models\Manager::class);
48
    }
49
50
    public function telework_allowed_frequency() //phpcs:ignore
51
    {
52
        return $this->belongsTo(\App\Models\Lookup\Frequency::class);
53
    }
54
55
    public function flexible_hours_frequency() //phpcs:ignore
56
    {
57
        return $this->belongsTo(\App\Models\Lookup\Frequency::class);
58
    }
59
60
    public function workplace_photo_captions() //phpcs:ignore
61
    {
62
        return $this->hasMany(\App\Models\WorkplacePhotoCaption::class);
63
    }
64
}
65