@@ -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 | { |
@@ -10,6 +10,10 @@ discard block |
||
10 | 10 | { |
11 | 11 | protected $serviceLocator; |
12 | 12 | |
13 | + /** |
|
14 | + * @param string $name |
|
15 | + * @param \SpeckCatalog\Model\Product $model |
|
16 | + */ |
|
13 | 17 | public function getForm($name = null, $model = null, $data = null) |
14 | 18 | { |
15 | 19 | $form = $this->formFromServiceManager($name); |
@@ -38,6 +42,10 @@ discard block |
||
38 | 42 | return $this->getServiceLocator()->get($filterName); |
39 | 43 | } |
40 | 44 | |
45 | + /** |
|
46 | + * @param string $name |
|
47 | + * @param \SpeckCatalog\Model\Product $model |
|
48 | + */ |
|
41 | 49 | public function getKeyFields($name, $model = null, $parentKeyFields = false) |
42 | 50 | { |
43 | 51 | $form = $this->formFromServiceManager($name); |
@@ -15,6 +15,7 @@ |
||
15 | 15 | * Set formService. |
16 | 16 | * |
17 | 17 | * @param formService the value to set. |
18 | + * @return \SpeckCatalog\View\Helper\Form |
|
18 | 19 | */ |
19 | 20 | public function setFormService($formService); |
20 | 21 | } |
@@ -34,6 +34,9 @@ discard block |
||
34 | 34 | return $options; |
35 | 35 | } |
36 | 36 | |
37 | + /** |
|
38 | + * @param integer $productId |
|
39 | + */ |
|
37 | 40 | public function getBuildersByProductId($productId) |
38 | 41 | { |
39 | 42 | $choices = $this->getEntityMapper()->getBuildersByProductId($productId); |
@@ -130,6 +133,9 @@ discard block |
||
130 | 133 | return true; //choice was found, and then deleted successfully |
131 | 134 | } |
132 | 135 | |
136 | + /** |
|
137 | + * @param integer $optionId |
|
138 | + */ |
|
133 | 139 | public function sortChoices($optionId, array $order = array()) |
134 | 140 | { |
135 | 141 | return $this->getEntityMapper()->sortChoices($optionId, $order); |
@@ -189,7 +195,7 @@ discard block |
||
189 | 195 | } |
190 | 196 | |
191 | 197 | /** |
192 | - * @param $productService |
|
198 | + * @param Product $productService |
|
193 | 199 | * @return self |
194 | 200 | */ |
195 | 201 | public function setProductService($productService) |
@@ -196,6 +196,7 @@ discard block |
||
196 | 196 | /** |
197 | 197 | * store new sort order for product options |
198 | 198 | * $order is array of position => optionId |
199 | + * @param integer $productId |
|
199 | 200 | */ |
200 | 201 | public function sortOptions($productId, array $order) |
201 | 202 | { |
@@ -241,6 +242,9 @@ discard block |
||
241 | 242 | return $this->getEntityMapper()->removeSpec($productId, $specId); |
242 | 243 | } |
243 | 244 | |
245 | + /** |
|
246 | + * @param \SpeckCatalog\Model\Product $dataOrModel |
|
247 | + */ |
|
244 | 248 | public function insert($dataOrModel) |
245 | 249 | { |
246 | 250 | $vars = array( |
@@ -264,6 +268,9 @@ discard block |
||
264 | 268 | // |
265 | 269 | } |
266 | 270 | |
271 | + /** |
|
272 | + * @param integer $categoryId |
|
273 | + */ |
|
267 | 274 | public function getByCategoryId($categoryId) |
268 | 275 | { |
269 | 276 | return $this->getEntityMapper()->getByCategoryId($categoryId); |
@@ -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 |
@@ -11,6 +11,9 @@ |
||
11 | 11 | protected $uomService; |
12 | 12 | protected $productService; |
13 | 13 | |
14 | + /** |
|
15 | + * @param integer $productId |
|
16 | + */ |
|
14 | 17 | public function getByProductId($productId, $populate = false, $recursive = false) |
15 | 18 | { |
16 | 19 | $productUoms = $this->getEntityMapper()->getByProductId($productId); |
@@ -15,11 +15,17 @@ |
||
15 | 15 | return $spec; |
16 | 16 | } |
17 | 17 | |
18 | + /** |
|
19 | + * @param integer $productId |
|
20 | + */ |
|
18 | 21 | public function getByProductId($productId) |
19 | 22 | { |
20 | 23 | return $this->getEntityMapper()->getByProductId($productId); |
21 | 24 | } |
22 | 25 | |
26 | + /** |
|
27 | + * @param \SpeckCatalog\Model\Spec $spec |
|
28 | + */ |
|
23 | 29 | public function insert($spec) |
24 | 30 | { |
25 | 31 | $id = parent::insert($spec); |
@@ -262,6 +262,9 @@ |
||
262 | 262 | return $this; |
263 | 263 | } |
264 | 264 | |
265 | + /** |
|
266 | + * @param string $name |
|
267 | + */ |
|
265 | 268 | public function getService($name) |
266 | 269 | { |
267 | 270 | if (!array_key_exists($name, $this->services)) { |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | //data needed to represent a uom to be displayed |
93 | 93 | $data = array( |
94 | 94 | 'enabled' => false, |
95 | - 'key' => $uom->getUomCode().$uom->getQuantity(), |
|
95 | + 'key' => $uom->getUomCode() . $uom->getQuantity(), |
|
96 | 96 | 'price' => 'N/A', |
97 | 97 | 'name' => $uom->getUom()->getName(), |
98 | 98 | 'code' => $uom->getUomCode(), |
99 | 99 | 'quantity' => $uom->getQuantity(), |
100 | - 'uom_string' => $uom->getUomCode().$uom->getQuantity(), |
|
100 | + 'uom_string' => $uom->getUomCode() . $uom->getQuantity(), |
|
101 | 101 | ); |
102 | 102 | if ($enabled) { |
103 | 103 | $data['enabled'] = true; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | public function renderMany($uoms, $uomString = null, $quantity = 1) |
171 | 171 | { |
172 | 172 | foreach ($uoms as $uom) { |
173 | - $key= $uom['key']; |
|
173 | + $key = $uom['key']; |
|
174 | 174 | $options[$key] = array( |
175 | 175 | 'value' => $key, |
176 | 176 | 'label' => $this->getDisplayName($uom, true), |
@@ -39,6 +39,9 @@ discard block |
||
39 | 39 | return (int) $result->getGeneratedValue(); |
40 | 40 | } |
41 | 41 | |
42 | + /** |
|
43 | + * @param integer $parentOptionId |
|
44 | + */ |
|
42 | 45 | public function insertChoice($parentOptionId) |
43 | 46 | { |
44 | 47 | $mapper = $this->getTestMapper(); |
@@ -48,6 +51,11 @@ discard block |
||
48 | 51 | return (int) $result->getGeneratedValue(); |
49 | 52 | } |
50 | 53 | |
54 | + /** |
|
55 | + * @param integer $productId |
|
56 | + * @param string $uomCode |
|
57 | + * @param integer $quantity |
|
58 | + */ |
|
51 | 59 | public function insertProductUom($productId, $uomCode, $quantity) |
52 | 60 | { |
53 | 61 | $productUom = array( |
@@ -61,6 +69,12 @@ discard block |
||
61 | 69 | $mapper->insert($productUom, 'catalog_product_uom'); |
62 | 70 | } |
63 | 71 | |
72 | + /** |
|
73 | + * @param integer $productId |
|
74 | + * @param string $uomCode |
|
75 | + * @param integer $quantity |
|
76 | + * @param integer $distributorId |
|
77 | + */ |
|
64 | 78 | public function insertAvailability($productId, $uomCode, $quantity, $distributorId) |
65 | 79 | { |
66 | 80 | $availability = array( |
@@ -74,6 +88,9 @@ discard block |
||
74 | 88 | $mapper->insert($availability, 'catalog_availability'); |
75 | 89 | } |
76 | 90 | |
91 | + /** |
|
92 | + * @param string $parentType |
|
93 | + */ |
|
77 | 94 | public function insertImage($parentType, $parentId = 1) |
78 | 95 | { |
79 | 96 | $mapper = $this->getTestMapper(); |
@@ -108,6 +125,10 @@ discard block |
||
108 | 125 | return (int) $result->getGeneratedValue(); |
109 | 126 | } |
110 | 127 | |
128 | + /** |
|
129 | + * @param string $uomCode |
|
130 | + * @param string $name |
|
131 | + */ |
|
111 | 132 | public function insertUom($uomCode, $name) |
112 | 133 | { |
113 | 134 | $uom = array('uom_code' => $uomCode, 'name' => $name); |