Completed
Push — master ( eb293d...24843b )
by claudio
28:25 queued 19:43
created

Meeting   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
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 43
ccs 4
cts 6
cp 0.6667
rs 10

3 Methods

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