Completed
Pull Request — dev (#297)
by Tristan
11:17
created

WorkEnvironment   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 14
dl 0
loc 29
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A telework_allowed_frequency() 0 2 1
A flexible_hours_frequency() 0 2 1
A manager() 0 2 1
A workplace_photo_captions() 0 2 1
1
<?php
2
3
/**
4
 * Created by Reliese Model.
5
 * Date: Thu, 12 Jul 2018 22:39:28 +0000.
6
 */
7
8
namespace App\Models;
9
use App\Models\Lookup\Frequency;
10
11
/**
12
 * Class WorkEnvironment
13
 *
14
 * @property int $id
15
 * @property int $manager_id
16
 * @property boolean $remote_work_allowed
17
 * @property int $telework_allowed_frequency_id
18
 * @property int $flexible_hours_frequency_id
19
 * @property \Jenssegers\Date\Date $created_at
20
 * @property \Jenssegers\Date\Date $updated_at
21
 *
22
 * @property \App\Models\Manager $manager
23
 * @property \App\Models\Lookup\Frequency $telework_allowed_frequency
24
 * @property \App\Models\Lookup\Frequency $flexible_hours_frequency
25
 * @property \Illuminate\Database\Eloquent\Collection $workplace_photo_captions
26
 */
27
class WorkEnvironment extends BaseModel {
28
29
    protected $casts = [
30
        'remote_work_allowed' => 'boolean'
31
    ];
32
    protected $fillable = [
33
        'remote_work_allowed',
34
        'telework_allowed_frequency_id',
35
        'flexible_hours_frequency_id'
36
    ];
37
    protected $with = [
38
        'telework_allowed_frequency',
39
        'flexible_hours_frequency'
40
    ];
41
42
    public function manager() {
43
        return $this->belongsTo(\App\Models\Manager::class);
44
    }
45
46
    public function telework_allowed_frequency() {
47
        return $this->belongsTo(\App\Models\Lookup\Frequency::class);
48
    }
49
50
    public function flexible_hours_frequency() {
51
        return $this->belongsTo(\App\Models\Lookup\Frequency::class);
52
    }
53
54
    public function workplace_photo_captions() {
55
        return $this->hasMany(\App\Models\WorkplacePhotoCaption::class);
56
    }
57
58
}
59