1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace plunner; |
4
|
|
|
|
5
|
|
|
use Illuminate\Database\Eloquent\Model; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class Meeting |
9
|
|
|
* |
10
|
|
|
* @author Claudio Cardinale <[email protected]> |
11
|
|
|
* @copyright 2015 Claudio Cardinale |
12
|
|
|
* @version 1.0.0 |
13
|
|
|
* @package plunner |
14
|
|
|
* @property integer $id |
15
|
|
|
* @property string $title |
16
|
|
|
* @property string $description |
17
|
|
|
* @property integer $group_id |
18
|
|
|
* @property string $start_time |
19
|
|
|
* @property integer $duration |
20
|
|
|
* @property \Carbon\Carbon $created_at |
21
|
|
|
* @property \Carbon\Carbon $updated_at |
22
|
|
|
* @property-read \plunner\Group $group |
23
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\plunner\MeetingTimeslot[] $timeslots |
24
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\plunner\Employee[] $employees |
25
|
|
|
*/ |
26
|
|
|
class Meeting extends Model |
27
|
|
|
{ |
28
|
|
|
/** |
29
|
|
|
* The attributes that are mass assignable. |
30
|
|
|
* |
31
|
|
|
* @var array |
32
|
|
|
*/ |
33
|
|
|
protected $fillable = ['title', 'description', 'duration']; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* The attributes excluded from the model's JSON form. |
37
|
|
|
* |
38
|
|
|
* @var array |
39
|
|
|
*/ |
40
|
|
|
protected $hidden = ['pivot']; |
41
|
|
|
|
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
45
|
|
|
*/ |
46
|
51 |
|
public function group() |
47
|
|
|
{ |
48
|
51 |
|
return $this->belongsTo(Group::class); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany |
53
|
|
|
*/ |
54
|
48 |
|
public function timeslots() |
55
|
|
|
{ |
56
|
48 |
|
return $this->hasMany('plunner\MeetingTimeslot'); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* get employees that partecipate to the meetings. |
61
|
|
|
* for all employees invited use groups with employees |
62
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany |
63
|
|
|
*/ |
64
|
|
|
public function employees() |
65
|
|
|
{ |
66
|
|
|
return $this->belongsToMany(Employee::class); |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|