@@ -15,13 +15,13 @@ |
||
15 | 15 | public function __construct(array $config = array()) |
16 | 16 | { |
17 | 17 | if (count($config)) { |
18 | - $this->parentOptionId = isset($config['parent_option_id']) ? $config['parent_option_id'] : null; |
|
19 | - $this->productId = isset($config['product_id']) ? $config['product_id'] : null; |
|
20 | - $this->itemNumber = isset($config['item_number']) ? $config['item_number'] : null; |
|
18 | + $this->parentOptionId = isset($config['parent_option_id']) ? $config['parent_option_id'] : null; |
|
19 | + $this->productId = isset($config['product_id']) ? $config['product_id'] : null; |
|
20 | + $this->itemNumber = isset($config['item_number']) ? $config['item_number'] : null; |
|
21 | 21 | $this->parentOptionName = isset($config['parent_option_name']) ? $config['parent_option_name'] : null; |
22 | - $this->flatOptions = isset($config['flat_options']) ? $config['flat_options'] : array(); |
|
23 | - $this->image = isset($config['image']) ? $config['image'] : null; |
|
24 | - $this->uom = isset($config['uom']) ? $config['uom'] : null; |
|
22 | + $this->flatOptions = isset($config['flat_options']) ? $config['flat_options'] : array(); |
|
23 | + $this->image = isset($config['image']) ? $config['image'] : null; |
|
24 | + $this->uom = isset($config['uom']) ? $config['uom'] : null; |
|
25 | 25 | } |
26 | 26 | } |
27 | 27 |
@@ -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 | } |
@@ -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 | } |