@@ -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; |
@@ -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 | { |
@@ -68,7 +68,7 @@ |
||
68 | 68 | if ($this->getPriceDiscountFixed()) { |
69 | 69 | return -$this->getPriceDiscountFixed(); |
70 | 70 | } elseif ($this->getPriceDiscountPercent()) { |
71 | - return $parentPrice * -($this->getPriceDiscountPercent()/100); |
|
71 | + return $parentPrice * -($this->getPriceDiscountPercent() / 100); |
|
72 | 72 | } elseif ($this->getPriceNoCharge()) { |
73 | 73 | return -$parentPrice; |
74 | 74 | } elseif ($this->getPriceOverrideFixed()) { |
@@ -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 | { |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | |
86 | 86 | public function addProduct($categoryOrId, $productOrId) |
87 | 87 | { |
88 | - $categoryId = ( is_numeric($categoryOrId) ? $categoryOrId : $categoryOrId->getCategoryId() ); |
|
89 | - $productId = ( is_numeric($productOrId) ? $productOrId : $productOrId->getProductId() ); |
|
88 | + $categoryId = (is_numeric($categoryOrId) ? $categoryOrId : $categoryOrId->getCategoryId()); |
|
89 | + $productId = (is_numeric($productOrId) ? $productOrId : $productOrId->getProductId()); |
|
90 | 90 | |
91 | 91 | return $this->getEntityMapper()->addProduct($categoryId, $productId); |
92 | 92 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | if (null === $categoryOrId) { |
97 | 97 | throw new \RuntimeException('categoryOrId cannot be null'); |
98 | 98 | } |
99 | - $categoryId = ( is_numeric($categoryOrId) ? $categoryOrId : $categoryOrId->getCategoryId() ); |
|
99 | + $categoryId = (is_numeric($categoryOrId) ? $categoryOrId : $categoryOrId->getCategoryId()); |
|
100 | 100 | |
101 | 101 | $parentCategoryId = ( |
102 | 102 | is_int($parentCategoryOrIdOrNull) |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | |
113 | 113 | public function setImage($categoryOrId, $imageOrId) |
114 | 114 | { |
115 | - $categoryId = ( is_int($categoryOrId) ? $categoryOrId : $categoryOrId->getCategoryId() ); |
|
116 | - $imageId = ( is_int($imageOrId) ? $imageOrId : $imageOrId->getMediaId() ); |
|
115 | + $categoryId = (is_int($categoryOrId) ? $categoryOrId : $categoryOrId->getCategoryId()); |
|
116 | + $imageId = (is_int($imageOrId) ? $imageOrId : $imageOrId->getMediaId()); |
|
117 | 117 | |
118 | 118 | return $this->getImageService()->addLinker('category', $categoryId, $imageId); |
119 | 119 | } |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | |
43 | 43 | public function addOption($choiceOrId, $optionOrId) |
44 | 44 | { |
45 | - $choiceId = ( is_int($choiceOrId) ? $choiceOrId : $choiceOrId->getChoiceId() ); |
|
46 | - $optionId = ( is_int($optionOrId) ? $optionOrId : $optionOrId->getOptionId() ); |
|
45 | + $choiceId = (is_int($choiceOrId) ? $choiceOrId : $choiceOrId->getChoiceId()); |
|
46 | + $optionId = (is_int($optionOrId) ? $optionOrId : $optionOrId->getOptionId()); |
|
47 | 47 | $this->getEntityMapper()->addOption($choiceId, $optionId); |
48 | 48 | return $this->getOptionService()->find(array('option_id' => $optionId)); |
49 | 49 | } |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | |
69 | 69 | public function removeOption($choiceOrId, $optionOrId) |
70 | 70 | { |
71 | - $productId = ( is_int($choiceOrId) ? $choiceOrId : $choiceOrId->getProductId() ); |
|
72 | - $optionId = ( is_int($optionOrId) ? $optionOrId : $optionOrId->getOptionId() ); |
|
71 | + $productId = (is_int($choiceOrId) ? $choiceOrId : $choiceOrId->getProductId()); |
|
72 | + $optionId = (is_int($optionOrId) ? $optionOrId : $optionOrId->getOptionId()); |
|
73 | 73 | $this->getEntityMapper()->removeOption($productId, $optionId); |
74 | 74 | } |
75 | 75 | |
76 | 76 | public function choiceFromProduct($productOrId) |
77 | 77 | { |
78 | - $product = ( !is_int($productOrId) ? $productOrId : $this->getProductService()->find($productOrId) ); |
|
78 | + $product = (!is_int($productOrId) ? $productOrId : $this->getProductService()->find($productOrId)); |
|
79 | 79 | $choice = $this->getEntity()->setProductId($product->getProductId()); |
80 | 80 | return $this->persist($choice); |
81 | 81 | } |
@@ -185,8 +185,8 @@ |
||
185 | 185 | |
186 | 186 | public function addOption($productOrId, $optionOrId) |
187 | 187 | { |
188 | - $productId = ( is_int($productOrId) ? $productOrId : $productOrId->getProductId() ); |
|
189 | - $optionId = ( is_int($optionOrId) ? $optionOrId : $optionOrId->getOptionId() ); |
|
188 | + $productId = (is_int($productOrId) ? $productOrId : $productOrId->getProductId()); |
|
189 | + $optionId = (is_int($optionOrId) ? $optionOrId : $optionOrId->getOptionId()); |
|
190 | 190 | |
191 | 191 | $this->getEntityMapper()->addOption($productId, $optionId); |
192 | 192 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | if ($product->has('features')) { |
18 | 18 | $str = '<ul>'; |
19 | 19 | $features = $product->getFeatures(); |
20 | - for ($i=0; $i < 3; $i++) { |
|
20 | + for ($i = 0; $i < 3; $i++) { |
|
21 | 21 | if ($features[$i]) { |
22 | 22 | $str .= '<li><span> ' . $features[$i] . '</span></li>'; |
23 | 23 | } |
@@ -141,6 +141,9 @@ discard block |
||
141 | 141 | return $this->getResponse()->setContent($html); |
142 | 142 | } |
143 | 143 | |
144 | + /** |
|
145 | + * @param string $helperName |
|
146 | + */ |
|
144 | 147 | public function getViewHelper($helperName) |
145 | 148 | { |
146 | 149 | return $this->getServiceLocator()->get('viewhelpermanager')->get($helperName); |
@@ -282,6 +285,9 @@ discard block |
||
282 | 285 | return $dash->__invoke($name); |
283 | 286 | } |
284 | 287 | |
288 | + /** |
|
289 | + * @return string |
|
290 | + */ |
|
285 | 291 | protected function camel($name) |
286 | 292 | { |
287 | 293 | $camel = new \Zend\Filter\Word\UnderscoreToCamelCase; |
@@ -4,37 +4,37 @@ discard block |
||
4 | 4 | 'speckcatalog_image_mapper' => false, |
5 | 5 | ], |
6 | 6 | 'factories' => [ |
7 | - 'speckcatalog_category_service' => function ($sm) { |
|
7 | + 'speckcatalog_category_service' => function($sm) { |
|
8 | 8 | $service = new \SpeckCatalog\Service\Category; |
9 | 9 | $domain = $sm->get('multisite_domain_data'); |
10 | 10 | $service->setSiteId($domain['website_id']); |
11 | 11 | return $service->setSiteId($domain['website_id']); |
12 | 12 | }, |
13 | - 'speckcatalog_product_image_service' => function ($sm) { |
|
13 | + 'speckcatalog_product_image_service' => function($sm) { |
|
14 | 14 | $service = new \SpeckCatalog\Service\Image; |
15 | 15 | $mapper = $sm->get('speckcatalog_image_mapper')->setParentType('product'); |
16 | 16 | return $service->setEntityMapper($mapper); |
17 | 17 | }, |
18 | - 'speckcatalog_option_image_service' => function ($sm) { |
|
18 | + 'speckcatalog_option_image_service' => function($sm) { |
|
19 | 19 | $service = new \SpeckCatalog\Service\Image; |
20 | 20 | $mapper = $sm->get('speckcatalog_image_mapper')->setParentType('option'); |
21 | 21 | return $service->setEntityMapper($mapper); |
22 | 22 | }, |
23 | - 'speckcatalog_module_options' => function ($sm) { |
|
23 | + 'speckcatalog_module_options' => function($sm) { |
|
24 | 24 | $config = $sm->get('Config'); |
25 | 25 | return new \SpeckCatalog\Options\ModuleOptions(isset($config['speckcatalog']) ? $config['speckcatalog'] : []); |
26 | 26 | }, |
27 | - 'speckcatalog_availability_form' => function ($sm) { |
|
27 | + 'speckcatalog_availability_form' => function($sm) { |
|
28 | 28 | $form = new \SpeckCatalog\Form\Availability; |
29 | 29 | $form->setCompanyService($sm->get('speckcatalog_company_service')); |
30 | 30 | return $form->init(); |
31 | 31 | }, |
32 | - 'speckcatalog_product_form' => function ($sm) { |
|
32 | + 'speckcatalog_product_form' => function($sm) { |
|
33 | 33 | $form = new \SpeckCatalog\Form\Product; |
34 | 34 | $form->setCompanyService($sm->get('speckcatalog_company_service')); |
35 | 35 | return $form->init(); |
36 | 36 | }, |
37 | - 'speckcatalog_product_uom_form' => function ($sm) { |
|
37 | + 'speckcatalog_product_uom_form' => function($sm) { |
|
38 | 38 | $form = new \SpeckCatalog\Form\ProductUom; |
39 | 39 | $form->setUomService($sm->get('speckcatalog_uom_service')); |
40 | 40 | return $form->init(); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | 'speckcatalog_db' => 'Zend\Db\Adapter\Adapter', |
45 | 45 | ], |
46 | 46 | 'initializers' => [ |
47 | - function ($instance, $sm) { |
|
47 | + function($instance, $sm) { |
|
48 | 48 | if ($instance instanceof \SpeckCatalog\Mapper\DbAdapterAwareInterface) { |
49 | 49 | $dbAdapter = $sm->get('speckcatalog_db'); |
50 | 50 | $instance->setDbAdapter($dbAdapter); |