@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | 'class' => 'SpeckCatalog\View\Helper\CssClass', |
17 | 17 | ), |
18 | 18 | 'factories' => array( |
19 | - 'speckCatalogProduct' => function ($sm) { |
|
19 | + 'speckCatalogProduct' => function($sm) { |
|
20 | 20 | $sm = $sm->getServiceLocator(); |
21 | 21 | $helper = new \SpeckCatalog\View\Helper\Product(); |
22 | 22 | $helper->setProductUomService($sm->get('speckcatalog_product_uom_service')); |
@@ -29,13 +29,13 @@ discard block |
||
29 | 29 | $helper->setPartialDir($options->getCatalogManagerPartialDir()); |
30 | 30 | return $helper; |
31 | 31 | }, |
32 | - 'speckCatalogOptionImageUploader' => function ($sm) { |
|
32 | + 'speckCatalogOptionImageUploader' => function($sm) { |
|
33 | 33 | $imageUploader = $sm->get('imageUploader'); |
34 | 34 | $element = array('name' => 'file_type', 'attributes' => array('value' => 'optionImage', 'type' => 'hidden')); |
35 | 35 | $imageUploader->getForm()->add($element); |
36 | 36 | return $imageUploader; |
37 | 37 | }, |
38 | - 'speckCatalogManagerSideNav' => function ($sm) { |
|
38 | + 'speckCatalogManagerSideNav' => function($sm) { |
|
39 | 39 | $sm = $sm->getServiceLocator(); |
40 | 40 | $app = $sm->get('application'); |
41 | 41 | $routeMatch = $app->getMvcEvent()->getRouteMatch(); |
@@ -43,36 +43,36 @@ discard block |
||
43 | 43 | $helper->setRouteMatch($routeMatch); |
44 | 44 | return $helper; |
45 | 45 | }, |
46 | - 'speckCatalogProductImageUploader' => function ($sm) { |
|
46 | + 'speckCatalogProductImageUploader' => function($sm) { |
|
47 | 47 | $imageUploader = $sm->get('imageUploader'); |
48 | 48 | $element = array('name' => 'file_type', 'attributes' => array('value' => 'productImage', 'type' => 'hidden')); |
49 | 49 | $imageUploader->getForm()->add($element); |
50 | 50 | return $imageUploader; |
51 | 51 | }, |
52 | - 'speckCatalogProductDocumentUploader' => function ($sm) { |
|
52 | + 'speckCatalogProductDocumentUploader' => function($sm) { |
|
53 | 53 | $uploader = $sm->get('imageUploader'); |
54 | 54 | $element = array('name' => 'file_type', 'attributes' => array('value' => 'productDocument', 'type' => 'hidden')); |
55 | 55 | $uploader->getForm()->add($element); |
56 | 56 | return $uploader; |
57 | 57 | }, |
58 | - 'speckCatalogCategoryNav' => function ($sm) { |
|
58 | + 'speckCatalogCategoryNav' => function($sm) { |
|
59 | 59 | $sm = $sm->getServiceLocator(); |
60 | 60 | $helper = new Helper\CategoryNav; |
61 | 61 | return $helper->setCategoryService($sm->get('speckcatalog_category_service')); |
62 | 62 | }, |
63 | - 'speckCatalogImage' => function ($sm) { |
|
63 | + 'speckCatalogImage' => function($sm) { |
|
64 | 64 | $sm = $sm->getServiceLocator(); |
65 | 65 | $settings = $sm->get('speckcatalog_module_options'); |
66 | 66 | return new Helper\MediaUrl($settings, 'image'); |
67 | 67 | }, |
68 | - 'speckCatalogFeaturedProducts' => function ($sm) { |
|
68 | + 'speckCatalogFeaturedProducts' => function($sm) { |
|
69 | 69 | $speckFeaturedProducts = $sm->get('speckFeaturedProducts'); |
70 | 70 | return $speckFeaturedProducts->setTemplate('/speck-catalog/product/feature-clip'); |
71 | 71 | }, |
72 | 72 | ), |
73 | 73 | 'initializers' => array( |
74 | - function($instance, $sm){ |
|
75 | - if($instance instanceof FormServiceAwareInterface){ |
|
74 | + function($instance, $sm) { |
|
75 | + if ($instance instanceof FormServiceAwareInterface) { |
|
76 | 76 | $sm = $sm->getServiceLocator(); |
77 | 77 | $formService = $sm->get('speckcatalog_form_service'); |
78 | 78 | $instance->setFormService($formService); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | public function getItems($a, $b) |
10 | 10 | { |
11 | - $items=parent::getItems($a, $b); |
|
11 | + $items = parent::getItems($a, $b); |
|
12 | 12 | $return = array(); |
13 | 13 | foreach ($items as $item) { |
14 | 14 | $return[] = $item; |
@@ -77,7 +77,7 @@ |
||
77 | 77 | $offset = ((($page * $perPage) - $perPage) + 1); //this is the first item on the page |
78 | 78 | |
79 | 79 | $paginatorVars['p'] = floor($offset / $_GET['nn']) + 1; //new page number |
80 | - $paginatorVars['n'] = $_GET['nn']; //new items per page |
|
80 | + $paginatorVars['n'] = $_GET['nn']; //new items per page |
|
81 | 81 | |
82 | 82 | $query = '?' . http_build_query($paginatorVars); |
83 | 83 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * flag is set to false if edit() has been called, |
14 | 14 | * to differentiate between a form for a new record, or an existing record. |
15 | 15 | */ |
16 | - protected $new=true; |
|
16 | + protected $new = true; |
|
17 | 17 | |
18 | 18 | /* |
19 | 19 | * automatically set the hydrator for the form |
@@ -220,7 +220,7 @@ |
||
220 | 220 | public function hydrate(array $data, AbstractModel $model = null, HydratorInterface $hydrator = null) |
221 | 221 | { |
222 | 222 | $hydrator = $hydrator ?: $this->getHydrator(); |
223 | - $model = $model ?: $this->getModel(); |
|
223 | + $model = $model ?: $this->getModel(); |
|
224 | 224 | |
225 | 225 | return $hydrator->hydrate($data, $model); |
226 | 226 | } |
@@ -34,6 +34,9 @@ discard block |
||
34 | 34 | protected $paginatorOptions; |
35 | 35 | protected $enabledOnly = false; |
36 | 36 | |
37 | + /** |
|
38 | + * @param string $tableName |
|
39 | + */ |
|
37 | 40 | public function getSelect($tableName = null) |
38 | 41 | { |
39 | 42 | return $this->getSql()->select($tableName ?: $this->getTableName()); |
@@ -85,6 +88,10 @@ discard block |
||
85 | 88 | } |
86 | 89 | |
87 | 90 | //return deleted nuber of rows |
91 | + |
|
92 | + /** |
|
93 | + * @param string $tableName |
|
94 | + */ |
|
88 | 95 | public function delete(array $where, $tableName = null) |
89 | 96 | { |
90 | 97 | $tableName = $tableName ?: $this->getTableName(); |
@@ -135,6 +142,10 @@ discard block |
||
135 | 142 | } |
136 | 143 | |
137 | 144 | //returns affected number of rows |
145 | + |
|
146 | + /** |
|
147 | + * @param string $tableName |
|
148 | + */ |
|
138 | 149 | public function update($dataOrModel, array $where, $tableName = null, HydratorInterface $hydrator = null) |
139 | 150 | { |
140 | 151 | $tableName = $tableName ?: $this->getTableName(); |
@@ -225,6 +236,9 @@ discard block |
||
225 | 236 | return $hydrator->hydrate($data, $model); |
226 | 237 | } |
227 | 238 | |
239 | + /** |
|
240 | + * @param Select $select |
|
241 | + */ |
|
228 | 242 | public function initPaginator($select, ResultSet\ResultSetInterface $resultSet = null) |
229 | 243 | { |
230 | 244 | $paginator = new Paginator(new PaginatorDbSelect($select, $this->getDbAdapter(), $resultSet)); |
@@ -241,7 +255,7 @@ discard block |
||
241 | 255 | } |
242 | 256 | |
243 | 257 | /** |
244 | - * @return hydrator |
|
258 | + * @return null|\Zend\Hydrator\HydratorInterface |
|
245 | 259 | */ |
246 | 260 | public function getHydrator() |
247 | 261 | { |
@@ -302,7 +316,7 @@ discard block |
||
302 | 316 | |
303 | 317 | /** |
304 | 318 | * @param Sql |
305 | - * @return AbstractDbMapper |
|
319 | + * @return AbstractMapper |
|
306 | 320 | */ |
307 | 321 | protected function setSql(Sql $sql) |
308 | 322 | { |
@@ -336,7 +350,7 @@ discard block |
||
336 | 350 | } |
337 | 351 | |
338 | 352 | /** |
339 | - * @return dbAdapter |
|
353 | + * @return Adapter |
|
340 | 354 | */ |
341 | 355 | public function getDbAdapter() |
342 | 356 | { |
@@ -412,6 +426,9 @@ discard block |
||
412 | 426 | return $this->enabledOnly; |
413 | 427 | } |
414 | 428 | |
429 | + /** |
|
430 | + * @param boolean $bool |
|
431 | + */ |
|
415 | 432 | public function setEnabledOnly($bool) |
416 | 433 | { |
417 | 434 | $this->enabledOnly = $bool; |
@@ -111,7 +111,7 @@ |
||
111 | 111 | 'INNER' |
112 | 112 | ) |
113 | 113 | ->where(array( |
114 | - $c_o . '.builder' => 1, |
|
114 | + $c_o . '.builder' => 1, |
|
115 | 115 | $c_p_o . '.product_id' => $productId, |
116 | 116 | )); |
117 | 117 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $data['name'] = $model->getName(); |
14 | 14 | $data['instruction'] = $model->getInstruction(); |
15 | 15 | $data['required'] = ($model->getRequired()) ? 1 : 0; |
16 | - $data['builder'] = ($model->getBuilder()) ? 1 : 0; |
|
16 | + $data['builder'] = ($model->getBuilder()) ? 1 : 0; |
|
17 | 17 | $data['option_type_id'] = $model->getOptionTypeId(); |
18 | 18 | |
19 | 19 | return $data; |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | |
46 | 46 | public function find(array $data) |
47 | 47 | { |
48 | - $table = $this->getTableName(); |
|
48 | + $table = $this->getTableName(); |
|
49 | 49 | if (isset($data['product_id'])) { |
50 | - $where = array('product_id' => $data['product_id']); |
|
50 | + $where = array('product_id' => $data['product_id']); |
|
51 | 51 | } else { |
52 | 52 | $where = array('item_number' => $data['item_number']); |
53 | 53 | } |
@@ -152,10 +152,10 @@ discard block |
||
152 | 152 | |
153 | 153 | $select = $this->getSelect($c_b_p) |
154 | 154 | ->columns(array('product_id', 'choice_id', 'option_id')) |
155 | - ->join($c_p_o, $c_p_o.'.option_id='.$c_b_p.'.option_id', array()) |
|
155 | + ->join($c_p_o, $c_p_o . '.option_id=' . $c_b_p . '.option_id', array()) |
|
156 | 156 | ->where(array( |
157 | - $c_b_p.'.product_id' => $builderProductId, |
|
158 | - $c_p_o.'.product_id' => $productId, |
|
157 | + $c_b_p . '.product_id' => $builderProductId, |
|
158 | + $c_p_o . '.product_id' => $productId, |
|
159 | 159 | )); |
160 | 160 | $rows = $this->selectMany($select); |
161 | 161 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | |
54 | 54 | public function __toString() |
55 | 55 | { |
56 | - $string = $this->has('distributor') ? $this->getDistributor()->getName(): '___' ; |
|
56 | + $string = $this->has('distributor') ? $this->getDistributor()->getName() : '___'; |
|
57 | 57 | return $string; |
58 | 58 | } |
59 | 59 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | protected $parent; |
11 | 11 | |
12 | 12 | /** |
13 | - * @return parent |
|
13 | + * @return AbstractModel |
|
14 | 14 | */ |
15 | 15 | public function getParent() |
16 | 16 | { |