1 | <?php |
||
20 | trait Traits |
||
21 | { |
||
22 | private $propItems = []; |
||
23 | private $propRmItems = []; |
||
24 | private $propMax = 0; |
||
25 | |||
26 | |||
27 | /** |
||
28 | * Adds a new property item or overwrite an existing one |
||
29 | * |
||
30 | * @param \Aimeos\MShop\Product\Item\Property\Iface $item New or existing property item |
||
31 | * @return \Aimeos\MShop\Common\Item\Iface Self object for method chaining |
||
|
|||
32 | */ |
||
33 | public function addPropertyItem( \Aimeos\MShop\Product\Item\Property\Iface $item ) |
||
40 | |||
41 | |||
42 | /** |
||
43 | * Removes an existing property item |
||
44 | * |
||
45 | * @param \Aimeos\MShop\Product\Item\Property\Iface $item Existing property item |
||
46 | * @return \Aimeos\MShop\Common\Item\Iface Self object for method chaining |
||
47 | * @throws \Aimeos\MShop\Exception If given property item isn't found |
||
48 | */ |
||
49 | public function deletePropertyItem( \Aimeos\MShop\Product\Item\Property\Iface $item ) |
||
64 | |||
65 | |||
66 | /** |
||
67 | * Removes a list of existing property items |
||
68 | * |
||
69 | * @param \Aimeos\MShop\Common\Item\Property\Iface[] $items Existing property items |
||
70 | * @return \Aimeos\MShop\Common\Item\Iface Self object for method chaining |
||
71 | * @throws \Aimeos\MShop\Exception If a property item isn't found |
||
72 | */ |
||
73 | public function deletePropertyItems( array $items ) |
||
86 | |||
87 | |||
88 | /** |
||
89 | * Returns the deleted property items |
||
90 | * |
||
91 | * @return \Aimeos\MShop\Common\Item\Property\Iface[] Property items |
||
92 | */ |
||
93 | public function getPropertyItemsDeleted() |
||
97 | |||
98 | |||
99 | /** |
||
100 | * Returns the property items of the product |
||
101 | * |
||
102 | * @param string|null $type Name of the property item type or null for all |
||
103 | * @param boolean $active True to return only active items, false to return all |
||
104 | * @return \Aimeos\MShop\Product\Item\Property\Iface[] Associative list of property IDs as keys and property items as values |
||
105 | */ |
||
106 | public function getPropertyItems( $type = null, $active = true ) |
||
121 | |||
122 | |||
123 | /** |
||
124 | * Sets the property items in the trait |
||
125 | * |
||
126 | * @param \Aimeos\MShop\Common\Item\Property\Iface[] $items Property items |
||
127 | */ |
||
128 | protected function setPropertyItems( array $items ) |
||
132 | } |
||
133 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.