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