Caldav   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 40%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 1
cbo 2
dl 0
loc 42
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
 * Class Caldav
9
 *
10
 * @author Claudio Cardinale <[email protected]>
11
 * @copyright 2015 Claudio Cardinale
12
 * @version 1.0.0
13
 * @package plunner
14
 * @property integer $calendar_id
15
 * @property string $url
16
 * @property string $username
17
 * @property string $password
18
 * @property string $calendar_name
19
 * @property string $sync_errors
20
 * @property \Carbon\Carbon $created_at
21
 * @property \Carbon\Carbon $updated_at
22
 * @property-read \plunner\Calendar $Calendar
23
 */
24
class Caldav extends Model
25
{
26
    /**
27
     * @var string
28
     */
29
    protected $primaryKey = 'calendar_id';
30
31
    /**
32
     * @var array
33
     */
34
    protected $touches = ['calendar'];
35
36
    /**
37
     * @var array
38
     */
39
    protected $fillable = ['url', 'username', 'password', 'calendar_name'];
40
41
    /**
42
     * The attributes excluded from the model's JSON form.
43
     *
44
     * @var array
45
     */
46
    protected $hidden = ['password'];
47
48
    /**
49
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
50
     */
51 12
    public function Calendar()
52
    {
53 12
        return $this->belongsTo(Calendar::class);
54
    }
55
56
    //TODO remmeber to don't allow to change timelsot for a caldav claendar
57
58
    /**
59
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
60
     */
61
    public function Employee()
62
    {
63
        $this->Calendar->Employee();
64
    }
65
}
66