1 | <?php |
||
19 | class Main |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * Database class instance |
||
24 | * @var \gplcart\core\Database $db |
||
25 | */ |
||
26 | protected $db; |
||
27 | |||
28 | /** |
||
29 | * Main constructor. |
||
30 | * @param Config $config |
||
31 | */ |
||
32 | public function __construct(Config $config) |
||
37 | |||
38 | /** |
||
39 | * Implements hook "library.list" |
||
40 | * @param array $libraries |
||
41 | */ |
||
42 | public function hookLibraryList(array &$libraries) |
||
55 | |||
56 | /** |
||
57 | * Implements hook "module.uninstall.after" |
||
58 | */ |
||
59 | public function hookModuleUninstallAfter() |
||
63 | |||
64 | /** |
||
65 | * Implements hook "module.install.before" |
||
66 | * @param null|string |
||
67 | */ |
||
68 | public function hookModuleInstallBefore(&$result) |
||
76 | |||
77 | /** |
||
78 | * Implements hook "route.list" |
||
79 | * @param array $routes |
||
80 | */ |
||
81 | public function hookRouteList(array &$routes) |
||
114 | |||
115 | /** |
||
116 | * Implements hook "order.add.before" |
||
117 | * @param array $data |
||
118 | */ |
||
119 | public function hookOrderAddBefore(array &$data) |
||
130 | |||
131 | /** |
||
132 | * Implements hook "user.role.permissions" |
||
133 | * @param array $permissions |
||
134 | */ |
||
135 | public function hookUserRolePermissions(array &$permissions) |
||
142 | |||
143 | |||
144 | /** |
||
145 | * Returns an array of boxes needed to fit all the order items |
||
146 | * @param array $order |
||
147 | * @param array $cart |
||
148 | * @return array |
||
149 | */ |
||
150 | public function packOrder(array $order, array $cart) |
||
154 | |||
155 | /** |
||
156 | * Pack an array of items into a given array of boxes |
||
157 | * @param array $items |
||
158 | * @param array $boxes |
||
159 | * @return array |
||
160 | */ |
||
161 | public function getPackedBoxes(array $items, array $boxes) |
||
165 | |||
166 | /** |
||
167 | * Returns an array of items that fit into the box |
||
168 | * @param array $items |
||
169 | * @param array $box |
||
170 | * @return array |
||
171 | */ |
||
172 | public function getFitItems(array $items, array $box) |
||
176 | |||
177 | /** |
||
178 | * Returns an array of database scheme |
||
179 | * @return array |
||
180 | */ |
||
181 | public function getDbScheme() |
||
204 | |||
205 | /** |
||
206 | * Returns the Box model instance |
||
207 | * @return \gplcart\modules\packer\models\Box |
||
208 | */ |
||
209 | public function getBoxModel() |
||
215 | |||
216 | /** |
||
217 | * Returns the Packer model instance |
||
218 | * @return \gplcart\modules\packer\models\Packer |
||
219 | */ |
||
220 | public function getPackerModel() |
||
226 | } |
||
227 |