1 | <?php |
||
14 | class PackedBox |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * Box used |
||
19 | * @var Box |
||
20 | */ |
||
21 | protected $box; |
||
22 | |||
23 | /** |
||
24 | * Items in the box |
||
25 | * @var PackedItemList |
||
26 | */ |
||
27 | protected $items; |
||
28 | |||
29 | /** |
||
30 | * Total weight of box |
||
31 | * @var int |
||
32 | */ |
||
33 | protected $weight; |
||
34 | |||
35 | /** |
||
36 | * Get box used |
||
37 | * @return Box |
||
38 | */ |
||
39 | 4 | public function getBox() |
|
43 | |||
44 | /** |
||
45 | * Get items packed |
||
46 | * @return PackedItemList |
||
47 | */ |
||
48 | 35 | public function getItems() |
|
52 | |||
53 | /** |
||
54 | * Get packed weight |
||
55 | * @return int weight in grams |
||
56 | */ |
||
57 | 9 | public function getWeight() |
|
71 | |||
72 | /** |
||
73 | * Get remaining width inside box for another item |
||
74 | * @return int |
||
75 | */ |
||
76 | 1 | public function getRemainingWidth() |
|
80 | |||
81 | /** |
||
82 | * Get remaining length inside box for another item |
||
83 | * @return int |
||
84 | */ |
||
85 | 1 | public function getRemainingLength() |
|
89 | |||
90 | /** |
||
91 | * Get remaining depth inside box for another item |
||
92 | * @return int |
||
93 | */ |
||
94 | 1 | public function getRemainingDepth() |
|
98 | |||
99 | /** |
||
100 | * Used width inside box for packing items |
||
101 | * @return int |
||
102 | */ |
||
103 | 5 | public function getUsedWidth() |
|
114 | |||
115 | /** |
||
116 | * Used length inside box for packing items |
||
117 | * @return int |
||
118 | */ |
||
119 | 5 | public function getUsedLength() |
|
130 | |||
131 | /** |
||
132 | * Used depth inside box for packing items |
||
133 | * @return int |
||
134 | */ |
||
135 | 5 | public function getUsedDepth() |
|
146 | |||
147 | /** |
||
148 | * Get remaining weight inside box for another item |
||
149 | * @return int |
||
150 | */ |
||
151 | 1 | public function getRemainingWeight() |
|
155 | |||
156 | /** |
||
157 | * @return int |
||
158 | */ |
||
159 | 5 | public function getInnerVolume() |
|
163 | |||
164 | /** |
||
165 | * Get volume utilisation of the packed box |
||
166 | * @return float |
||
167 | */ |
||
168 | 1 | public function getVolumeUtilisation() |
|
179 | |||
180 | |||
181 | /** |
||
182 | * Constructor |
||
183 | * |
||
184 | * @param Box $box |
||
185 | * @param PackedItemList $itemList |
||
186 | */ |
||
187 | 38 | public function __construct(Box $box, PackedItemList $itemList) |
|
192 | } |
||
193 |