Completed
Push — master ( b9f835...490cda )
by claudio
08:44 queued 05:46
created

Calendar::timeslots()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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