@@ -236,7 +236,7 @@ |
||
236 | 236 | * |
237 | 237 | * @param \Aimeos\MShop\Common\Item\Iface $item Attribute item |
238 | 238 | * @param boolean $fetch True if the new ID should be returned in the item |
239 | - * @return \Aimeos\MShop\Common\Item\Iface $item Updated item including the generated ID |
|
239 | + * @return \Aimeos\MShop\Common\Item\ListRef\Iface $item Updated item including the generated ID |
|
240 | 240 | * @throws \Aimeos\MShop\Attribute\Exception If Attribute couldn't be saved |
241 | 241 | */ |
242 | 242 | public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | /** |
272 | 272 | * Deletes the item specified by its ID. |
273 | 273 | * |
274 | - * @param mixed $id ID of the item object |
|
274 | + * @param string $id ID of the item object |
|
275 | 275 | */ |
276 | 276 | public function deleteItem( $id ) |
277 | 277 | { |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | /** |
295 | 295 | * Removes multiple items specified by ids in the array. |
296 | 296 | * |
297 | - * @param array $ids List of IDs |
|
297 | + * @param integer[] $ids List of IDs |
|
298 | 298 | */ |
299 | 299 | public function deleteItems( array $ids ) |
300 | 300 | { |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | * |
445 | 445 | * @param \Aimeos\MShop\Common\Item\Iface $item Item object whose data should be saved |
446 | 446 | * @param boolean $fetch True if the new ID should be returned in the item |
447 | - * @return \Aimeos\MShop\Common\Item\Iface $item Updated item including the generated ID |
|
447 | + * @return \Aimeos\MShop\Common\Item\ListRef\Iface $item Updated item including the generated ID |
|
448 | 448 | */ |
449 | 449 | public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
450 | 450 | { |
@@ -483,6 +483,7 @@ discard block |
||
483 | 483 | * @param \Aimeos\MW\Criteria\Iface $search Search criteria object |
484 | 484 | * @param string[] $ref List of domains to fetch list items and referenced items for |
485 | 485 | * @param integer|null &$total Number of items that are available in total |
486 | + * @param integer $total |
|
486 | 487 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface |
487 | 488 | */ |
488 | 489 | public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null ) |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @param string $domain Name of the domain (e.g. media, text, etc.) |
51 | 51 | * @param \Aimeos\MShop\Common\Item\Lists\Iface $listItem List item referencing the new domain item |
52 | 52 | * @param \Aimeos\MShop\Common\Item\Iface|null $refItem New item added to the given domain or null if no item should be referenced |
53 | - * @return \Aimeos\MShop\Common\Item\ListRef\Iface Self object for method chaining |
|
53 | + * @return Base Self object for method chaining |
|
54 | 54 | */ |
55 | 55 | public function addRefItem( $domain, \Aimeos\MShop\Common\Item\Lists\Iface $listItem, \Aimeos\MShop\Common\Item\Iface $refItem = null ) |
56 | 56 | { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @param string $domain Name of the domain (e.g. media, text, etc.) |
76 | 76 | * @param \Aimeos\MShop\Common\Item\Lists\Iface $listItem List item referencing the domain item |
77 | 77 | * @param \Aimeos\MShop\Common\Item\Iface|null $refItem Existing item removed from the given domain or null if item shouldn't be removed |
78 | - * @return \Aimeos\MShop\Common\Item\ListRef\Iface Self object for method chaining |
|
78 | + * @return Base Self object for method chaining |
|
79 | 79 | */ |
80 | 80 | public function deleteRefItem( $domain, \Aimeos\MShop\Common\Item\Lists\Iface $listItem, \Aimeos\MShop\Common\Item\Iface $refItem = null ) |
81 | 81 | { |
@@ -191,9 +191,9 @@ discard block |
||
191 | 191 | * to the requested domain to get the items. Otherwise, no items will be |
192 | 192 | * returned by this method. |
193 | 193 | * |
194 | - * @param array|string|null $domain Name/Names of the domain (e.g. product, text, etc.) or null for all |
|
194 | + * @param string $domain Name/Names of the domain (e.g. product, text, etc.) or null for all |
|
195 | 195 | * @param array|string|null $type Name/Names of the item type or null for all |
196 | - * @param array|string|null $listtype Name/Names of the list item type or null for all |
|
196 | + * @param string $listtype Name/Names of the list item type or null for all |
|
197 | 197 | * @param boolean $active True to return only active items, false to return all |
198 | 198 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface |
199 | 199 | */ |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function addRefItem( $domain, \Aimeos\MShop\Common\Item\Lists\Iface $listItem, \Aimeos\MShop\Common\Item\Iface $refItem = null ) |
56 | 56 | { |
57 | - $id = $listItem->getId() ?: 'tmp-' . $this->max++; |
|
57 | + $id = $listItem->getId() ?: 'tmp-'.$this->max++; |
|
58 | 58 | $this->listItems[$domain][$id] = $listItem->setDomain( $domain )->setRefItem( $refItem ); |
59 | 59 | |
60 | 60 | if( $refItem !== null ) |
61 | 61 | { |
62 | - $id = $refItem->getId() ?: 'tmp-' . $this->max++; |
|
62 | + $id = $refItem->getId() ?: 'tmp-'.$this->max++; |
|
63 | 63 | $listItem->setRefId( $id ); |
64 | 64 | |
65 | 65 | $this->refItems[$domain][$id] = $refItem; |
@@ -164,11 +164,11 @@ discard block |
||
164 | 164 | |
165 | 165 | foreach( $list as $id => $item ) |
166 | 166 | { |
167 | - if( $listtype && ( !($item instanceof $iface) || !in_array( $item->getType(), $listTypes ) ) ) { |
|
167 | + if( $listtype && ( !( $item instanceof $iface ) || !in_array( $item->getType(), $listTypes ) ) ) { |
|
168 | 168 | continue; |
169 | 169 | } |
170 | 170 | |
171 | - if( $type && ( !($item->getRefItem() instanceof $iface) || !in_array( $item->getRefItem()->getType(), $types ) ) ) { |
|
171 | + if( $type && ( !( $item->getRefItem() instanceof $iface ) || !in_array( $item->getRefItem()->getType(), $types ) ) ) { |
|
172 | 172 | continue; |
173 | 173 | } |
174 | 174 |
@@ -218,6 +218,7 @@ |
||
218 | 218 | * Adds new, updates existing and deletes removed referenced items |
219 | 219 | * |
220 | 220 | * @param \Aimeos\MShop\Common\Item\ListRef\Iface $item Item with referenced items |
221 | + * @param string $domain |
|
221 | 222 | * @return \Aimeos\MShop\Common\Item\ListRef\Iface $item with updated referenced items |
222 | 223 | */ |
223 | 224 | protected function saveRefItems( \Aimeos\MShop\Common\Item\ListRef\Iface $item, $domain ) |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function updateListItems( \Aimeos\MShop\Common\Item\ListRef\Iface $item, array $map, $domain, $type ) |
36 | 36 | { |
37 | - $listManager = $this->getObject()->getSubManager( 'lists' ); |
|
37 | + $listManager = $this->getObject()->getSubManager( 'lists' ); |
|
38 | 38 | |
39 | 39 | if( !isset( $this->typeIds[$domain][$type] ) ) |
40 | 40 | { |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | |
162 | 162 | $search = $manager->createSearch(); |
163 | 163 | |
164 | - $expr = [ $search->compare( '==', $prefix . '.lists.parentid', $ids ) ]; |
|
164 | + $expr = [$search->compare( '==', $prefix.'.lists.parentid', $ids )]; |
|
165 | 165 | |
166 | 166 | if( $domains !== null ) { |
167 | - $expr[] = $search->compare( '==', $prefix . '.lists.domain', $domains ); |
|
167 | + $expr[] = $search->compare( '==', $prefix.'.lists.domain', $domains ); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | $search->setConditions( $search->combine( '&&', $expr ) ); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $manager = \Aimeos\MShop\Factory::createManager( $context, $domain ); |
193 | 193 | |
194 | 194 | $search = $manager->createSearch(); |
195 | - $search->setConditions( $search->compare( '==', str_replace( '/', '.', $domain ) . '.id', array_keys( $list ) ) ); |
|
195 | + $search->setConditions( $search->compare( '==', str_replace( '/', '.', $domain ).'.id', array_keys( $list ) ) ); |
|
196 | 196 | $search->setSlice( 0, 0x7fffffff ); |
197 | 197 | |
198 | 198 | foreach( $manager->searchItems( $search ) as $id => $item ) |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | { |
225 | 225 | $rmListIds = $rmIds = []; |
226 | 226 | $context = $this->getContext(); |
227 | - $listManager = \Aimeos\MShop\Factory::createManager( $context, $domain . '/lists' ); |
|
227 | + $listManager = \Aimeos\MShop\Factory::createManager( $context, $domain.'/lists' ); |
|
228 | 228 | |
229 | 229 | foreach( $item->getDeletedItems() as $listItem ) |
230 | 230 | { |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | * |
367 | 367 | * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object |
368 | 368 | * @param boolean $fetch True if the new ID should be returned in the item |
369 | - * @return \Aimeos\MShop\Common\Item\Iface $item Updated item including the generated ID |
|
369 | + * @return \Aimeos\MShop\Common\Item\ListRef\Iface $item Updated item including the generated ID |
|
370 | 370 | */ |
371 | 371 | public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
372 | 372 | { |
@@ -571,6 +571,7 @@ discard block |
||
571 | 571 | * @param \Aimeos\MW\Criteria\Iface $search Search criteria object |
572 | 572 | * @param string[] $ref List of domains to fetch list items and referenced items for |
573 | 573 | * @param integer|null &$total Number of items that are available in total |
574 | + * @param integer $total |
|
574 | 575 | * @return array Associative list of IDs as keys and items implementing \Aimeos\MShop\Customer\Item\Iface as values |
575 | 576 | */ |
576 | 577 | public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null ) |
@@ -273,7 +273,7 @@ |
||
273 | 273 | * |
274 | 274 | * @param \Aimeos\MShop\Media\Item\Iface $item New item that should be saved to the storage |
275 | 275 | * @param boolean $fetch True if the new ID should be returned in the item |
276 | - * @return \Aimeos\MShop\Common\Item\Iface $item Updated item including the generated ID |
|
276 | + * @return \Aimeos\MShop\Common\Item\ListRef\Iface $item Updated item including the generated ID |
|
277 | 277 | */ |
278 | 278 | public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
279 | 279 | { |
@@ -305,7 +305,7 @@ |
||
305 | 305 | * |
306 | 306 | * @param \Aimeos\MShop\Price\Item\Iface $item Price item object |
307 | 307 | * @param boolean $fetch True if the new ID should be returned in the item |
308 | - * @return \Aimeos\MShop\Common\Item\Iface $item Updated item including the generated ID |
|
308 | + * @return \Aimeos\MShop\Common\Item\ListRef\Iface $item Updated item including the generated ID |
|
309 | 309 | * @throws \Aimeos\MShop\Price\Exception If price couldn't be saved |
310 | 310 | */ |
311 | 311 | public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
@@ -205,7 +205,7 @@ |
||
205 | 205 | * |
206 | 206 | * @param \Aimeos\MShop\Common\Item\Iface $item Product item that should be saved to the storage |
207 | 207 | * @param boolean $fetch True if the new ID should be returned in the item |
208 | - * @return \Aimeos\MShop\Common\Item\Iface $item Updated item including the generated ID |
|
208 | + * @return \Aimeos\MShop\Common\Item\ListRef\Iface $item Updated item including the generated ID |
|
209 | 209 | */ |
210 | 210 | public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
211 | 211 | { |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | * |
299 | 299 | * @param \Aimeos\MShop\Common\Item\Iface $item New or existing service item that should be saved to the storage |
300 | 300 | * @param boolean $fetch True if the new ID should be returned in the item |
301 | - * @return \Aimeos\MShop\Common\Item\Iface $item Updated item including the generated ID |
|
301 | + * @return \Aimeos\MShop\Common\Item\ListRef\Iface $item Updated item including the generated ID |
|
302 | 302 | */ |
303 | 303 | public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
304 | 304 | { |
@@ -482,6 +482,7 @@ discard block |
||
482 | 482 | * @param \Aimeos\MW\Criteria\Iface $search Search criteria object |
483 | 483 | * @param string[] $ref List of domains to fetch list items and referenced items for |
484 | 484 | * @param integer|null &$total Number of items that are available in total |
485 | + * @param integer $total |
|
485 | 486 | * @return array List of service items implementing \Aimeos\MShop\Service\Item\Iface |
486 | 487 | */ |
487 | 488 | public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null ) |