Completed
Push — master ( 2c87a7...c05784 )
by claudio
04:06
created

Group::company()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace plunner;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * plunner\Group
9
 *
10
 * @property integer $id
11
 * @property \Carbon\Carbon $created_at
12
 * @property \Carbon\Carbon $updated_at
13
 * @property string $name
14
 * @property string $description
15
 * @property integer $planner_id
16
 * @property-read \Illuminate\Database\Eloquent\Collection|\plunner\Employee[] $employees
17
 * @method static \Illuminate\Database\Query\Builder|\plunner\Group whereId($value)
18
 * @method static \Illuminate\Database\Query\Builder|\plunner\Group whereCreatedAt($value)
19
 * @method static \Illuminate\Database\Query\Builder|\plunner\Group whereUpdatedAt($value)
20
 * @method static \Illuminate\Database\Query\Builder|\plunner\Group whereName($value)
21
 * @method static \Illuminate\Database\Query\Builder|\plunner\Group whereDescription($value)
22
 * @method static \Illuminate\Database\Query\Builder|\plunner\Group wherePlannerId($value)
23
 * @property integer $company_id
24
 * @method static \Illuminate\Database\Query\Builder|\plunner\Group whereCompanyId($value)
25
 */
26
class Group extends Model
27
{
28
    /**
29
     * The database table used by the model.
30
     *
31
     * @var string
32
     */
33
    protected $table = 'groups';
34
35
    /**
36
     * The attributes that are mass assignable.
37
     *
38
     * @var array
39
     */
40
    protected $fillable = ['name', 'description', 'planner_id'];
41
42
    /**
43
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
44
     */
45
    public function employees()
46
    {
47
        return $this->belongsToMany(Employee::class);
48
    }
49
50
    public function planner()
51
    {
52
        return $this->belongsTo(Planner::class);
53
    }
54
55
    public function company()
56
    {
57
        return $this->belongsTo(Company::class);
58
    }
59
}
60