Calendar::employee()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace plunner;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class Calendar
9
 *
10
 * @author Claudio Cardinale <[email protected]>
11
 * @copyright 2015 Claudio Cardinale
12
 * @version 1.0.0
13
 * @package plunner
14
 * @property integer $id
15
 * @property string $name
16
 * @property integer $employee_id
17
 * @property boolean $enabled
18
 * @property \Carbon\Carbon $created_at
19
 * @property \Carbon\Carbon $updated_at
20
 * @property-read \plunner\Employee $employee
21
 * @property-read \Illuminate\Database\Eloquent\Collection|\plunner\Timeslot[] $timeslots
22
 * @property-read \plunner\Caldav $Caldav
23
 */
24
class Calendar extends Model
25
{
26
    /**
27
     * The attributes that are mass assignable.
28
     *
29
     * @var array
30
     */
31
    protected $fillable = ['name', 'enabled'];
32
33
    /**
34
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
35
     */
36
    public function employee()
37
    {
38
        return $this->belongsTo('plunner\Employee');
39
    }
40
41
    /**
42
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
43
     */
44 24
    public function timeslots()
45
    {
46 24
        return $this->hasMany('plunner\Timeslot');
47
    }
48
49
    /**
50
     * @return \Illuminate\Database\Eloquent\Relations\HasOne|null
51
     */
52 24
    public function Caldav()
53
    {
54 24
        return $this->hasOne(Caldav::class);
55
    }
56
}
57