1 | <?php |
||
20 | trait Traits |
||
21 | { |
||
22 | /** |
||
23 | * Returns the property items for the given parent IDs |
||
24 | * |
||
25 | * @param array $parentIds List of parent IDs |
||
26 | * @param string $domain Domain of the calling manager |
||
27 | * @return array Associative list of parent IDs / property IDs as keys and items implementing |
||
28 | * \Aimeos\MShop\Common\Item\Property\Iface as values |
||
29 | */ |
||
30 | protected function getPropertyItems( array $parentIds, $domain ) |
||
50 | |||
51 | |||
52 | /** |
||
53 | * Adds new, updates existing and deletes removed property items |
||
54 | * |
||
55 | * @param \Aimeos\MShop\Common\Item\ListRef\Iface $item Item with referenced items |
||
56 | * @param string $domain Domain of the calling manager |
||
57 | * @return \Aimeos\MShop\Common\Item\ListRef\Iface Item with saved referenced items |
||
58 | */ |
||
59 | protected function savePropertyItems( \Aimeos\MShop\Common\Item\PropertyRef\Iface $item, $domain ) |
||
76 | } |
||
77 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.