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
|
|
|
|