Completed
Pull Request — master (#28)
by claudio
06:52 queued 01:55
created

Calendar   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 33
ccs 4
cts 6
cp 0.6667
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A employee() 0 4 1
A Caldav() 0 4 1
A timeslots() 0 4 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