@@ -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 addListItem( $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 | * @throws \Aimeos\MShop\Exception If given list item isn't found |
80 | 80 | */ |
81 | 81 | public function deleteListItem( $domain, \Aimeos\MShop\Common\Item\Lists\Iface $listItem, \Aimeos\MShop\Common\Item\Iface $refItem = null ) |
@@ -214,9 +214,9 @@ discard block |
||
214 | 214 | * to the requested domain to get the items. Otherwise, no items will be |
215 | 215 | * returned by this method. |
216 | 216 | * |
217 | - * @param array|string|null $domain Name/Names of the domain (e.g. product, text, etc.) or null for all |
|
217 | + * @param string $domain Name/Names of the domain (e.g. product, text, etc.) or null for all |
|
218 | 218 | * @param array|string|null $type Name/Names of the item type or null for all |
219 | - * @param array|string|null $listtype Name/Names of the list item type or null for all |
|
219 | + * @param string $listtype Name/Names of the list item type or null for all |
|
220 | 220 | * @param boolean $active True to return only active items, false to return all |
221 | 221 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface |
222 | 222 | */ |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function addListItem( $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; |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | |
188 | 188 | foreach( $list as $id => $item ) |
189 | 189 | { |
190 | - if( $listtype && ( !($item instanceof $iface) || !in_array( $item->getType(), $listTypes ) ) ) { |
|
190 | + if( $listtype && ( !( $item instanceof $iface ) || !in_array( $item->getType(), $listTypes ) ) ) { |
|
191 | 191 | continue; |
192 | 192 | } |
193 | 193 | |
194 | - if( $type && ( !($item->getRefItem() instanceof $iface) || !in_array( $item->getRefItem()->getType(), $types ) ) ) { |
|
194 | + if( $type && ( !( $item->getRefItem() instanceof $iface ) || !in_array( $item->getRefItem()->getType(), $types ) ) ) { |
|
195 | 195 | continue; |
196 | 196 | } |
197 | 197 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * Adds a new property item or overwrite an existing one |
29 | 29 | * |
30 | 30 | * @param \Aimeos\MShop\Common\Item\Property\Iface $item New or existing property item |
31 | - * @return \Aimeos\MShop\Common\Item\Iface Self object for method chaining |
|
31 | + * @return Traits Self object for method chaining |
|
32 | 32 | */ |
33 | 33 | public function addPropertyItem( \Aimeos\MShop\Common\Item\Property\Iface $item ) |
34 | 34 | { |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * Removes an existing property item |
44 | 44 | * |
45 | 45 | * @param \Aimeos\MShop\Common\Item\Property\Iface $item Existing property item |
46 | - * @return \Aimeos\MShop\Common\Item\Iface Self object for method chaining |
|
46 | + * @return Traits Self object for method chaining |
|
47 | 47 | * @throws \Aimeos\MShop\Exception If given property item isn't found |
48 | 48 | */ |
49 | 49 | public function deletePropertyItem( \Aimeos\MShop\Common\Item\Property\Iface $item ) |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * Removes a list of existing property items |
68 | 68 | * |
69 | 69 | * @param \Aimeos\MShop\Common\Item\Property\Iface[] $items Existing property items |
70 | - * @return \Aimeos\MShop\Common\Item\Iface Self object for method chaining |
|
70 | + * @return Traits Self object for method chaining |
|
71 | 71 | * @throws \Aimeos\MShop\Exception If an item isn't a property item or isn't found |
72 | 72 | */ |
73 | 73 | public function deletePropertyItems( array $items ) |
@@ -13,6 +13,9 @@ |
||
13 | 13 | { |
14 | 14 | use \Aimeos\MShop\Common\Item\PropertyRef\Traits; |
15 | 15 | |
16 | + /** |
|
17 | + * @param \Aimeos\MShop\Common\Item\Property\Standard[] $list |
|
18 | + */ |
|
16 | 19 | public function setPropertyItems( $list ) |
17 | 20 | { |
18 | 21 | $this->propItems = $list; |
@@ -29,8 +29,8 @@ |
||
29 | 29 | |
30 | 30 | protected function setUp() |
31 | 31 | { |
32 | - $this->propItem = new \Aimeos\MShop\Common\Item\Property\Standard( 'c.', ['languageid' => 'de', 'c.type' => 'test']); |
|
33 | - $this->propItem2 = new \Aimeos\MShop\Common\Item\Property\Standard( 'c.', ['languageid' => 'de', 'c.languageid' => 'en', 'c.type' => 'test2']); |
|
32 | + $this->propItem = new \Aimeos\MShop\Common\Item\Property\Standard( 'c.', ['languageid' => 'de', 'c.type' => 'test'] ); |
|
33 | + $this->propItem2 = new \Aimeos\MShop\Common\Item\Property\Standard( 'c.', ['languageid' => 'de', 'c.languageid' => 'en', 'c.type' => 'test2'] ); |
|
34 | 34 | |
35 | 35 | $this->object = new TraitsClass(); |
36 | 36 | $this->object->setPropertyItems( [$this->propItem, $this->propItem2] ); |