Completed
Pull Request — master (#10)
by claudio
04:11
created

Caldav   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 40%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 2
c 4
b 0
f 0
lcom 1
cbo 2
dl 0
loc 32
ccs 2
cts 5
cp 0.4
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A Calendar() 0 4 1
A Employee() 0 4 1
1
<?php
2
3
namespace plunner;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * plunner\Caldav
9
 *
10
 * @property integer $calendar_id
11
 * @property string $url
12
 * @property string $username
13
 * @property string $password
14
 * @property string $calendar_name
15
 * @property \Carbon\Carbon $created_at
16
 * @property \Carbon\Carbon $updated_at
17
 * @property-read Calendar $Calendar
18
 * @method static \Illuminate\Database\Query\Builder|\plunner\Caldav whereCalendarId($value)
19
 * @method static \Illuminate\Database\Query\Builder|\plunner\Caldav whereUrl($value)
20
 * @method static \Illuminate\Database\Query\Builder|\plunner\Caldav whereUsername($value)
21
 * @method static \Illuminate\Database\Query\Builder|\plunner\Caldav wherePassword($value)
22
 * @method static \Illuminate\Database\Query\Builder|\plunner\Caldav whereCalendarName($value)
23
 * @method static \Illuminate\Database\Query\Builder|\plunner\Caldav whereCreatedAt($value)
24
 * @method static \Illuminate\Database\Query\Builder|\plunner\Caldav whereUpdatedAt($value)
25
 */
26
class Caldav extends Model
27
{
28
    //TODO fillable and other fields
29
30
    /**
31
     * @var string
32
     */
33
    protected $primaryKey = 'calendar_id';
34
35
    /**
36
     * @var array
37
     */
38
    protected $touches = ['calendar'];
39
40
    /**
41
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
42
     */
43 4
    public function Calendar()
44
    {
45 4
        return $this->belongsTo(Calendar::class);
46
    }
47
48
    //TODO remmeber to don't allow to change timelsot for a caldav claendar
49
50
    /**
51
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
52
     */
53
    public function Employee()
54
    {
55
        $this->Calendar->Employee();
56
    }
57
}
58