Total Complexity | 4 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | trait ProductsAwareTrait |
||
11 | { |
||
12 | /** |
||
13 | * @var Collection|ProductInterface[] |
||
14 | */ |
||
15 | protected $products; |
||
16 | |||
17 | /** |
||
18 | * {@inheritdoc} |
||
19 | */ |
||
20 | public function __construct() |
||
21 | { |
||
22 | $this->products = new ArrayCollection(); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | public function hasProducts(): bool |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | public function getProducts(): Collection |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function hasProduct(ProductInterface $product): bool |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | abstract public function addProduct(ProductInterface $product): void; |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | abstract public function removeProduct(ProductInterface $product): void; |
||
58 | } |
||
59 |