1 | <?php |
||
7 | class Warehouse extends Eloquent\Model |
||
8 | { |
||
9 | /** |
||
10 | * We do not want any timestamps. |
||
11 | * |
||
12 | * @var bool |
||
13 | */ |
||
14 | public $timestamps = false; |
||
15 | |||
16 | /** |
||
17 | * The attributes that are mass assignable. |
||
18 | * |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $fillable = ['name']; |
||
22 | |||
23 | /** |
||
24 | * Racks in the warehouse. |
||
25 | * |
||
26 | * @return Eloquent\Relations\HasMany |
||
27 | */ |
||
28 | 6 | public function racks() |
|
32 | |||
33 | /** |
||
34 | * Guitars in the warehouse. |
||
35 | * |
||
36 | * @return Eloquent\Relations\HasManyThrough |
||
37 | */ |
||
38 | public function guitars() |
||
42 | |||
43 | /** |
||
44 | * Add rack to the warehouse. |
||
45 | * |
||
46 | * @param array|Rack $rack |
||
47 | * |
||
48 | * @return Eloquent\Model |
||
49 | */ |
||
50 | 4 | public function addRack($rack) |
|
59 | |||
60 | /** |
||
61 | * Add racks to the warehouse. |
||
62 | * |
||
63 | * @param Eloquent\Collection|array $racks |
||
64 | * |
||
65 | * @return $this |
||
66 | */ |
||
67 | 2 | public function addRacks($racks) |
|
75 | |||
76 | /** |
||
77 | * Remove racks using ids. |
||
78 | * |
||
79 | * @param $ids |
||
80 | * |
||
81 | * @return $this |
||
82 | */ |
||
83 | 1 | public function removeRacksNotIn($ids) |
|
89 | |||
90 | /** |
||
91 | * Add or Update Racks. |
||
92 | * |
||
93 | * @param $rack |
||
94 | * |
||
95 | * @return $this |
||
96 | */ |
||
97 | 2 | public function addOrUpdateRack($rack) |
|
104 | |||
105 | /** |
||
106 | * Add or update the racks. |
||
107 | * |
||
108 | * @param $racks |
||
109 | * |
||
110 | * @return $this |
||
111 | */ |
||
112 | public function addOrUpdateRacks($racks) |
||
120 | } |
||
121 |