Total Complexity | 7 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
17 | trait ProductsAwareTrait |
||
18 | { |
||
19 | /** @var Collection|ProductInterface[] */ |
||
20 | protected $products; |
||
21 | |||
22 | public function initializeProductsCollection(): void |
||
23 | { |
||
24 | $this->products = new ArrayCollection(); |
||
25 | } |
||
26 | |||
27 | public function getProducts(): Collection |
||
30 | } |
||
31 | |||
32 | public function hasProduct(ProductInterface $product): bool |
||
35 | } |
||
36 | |||
37 | public function addProduct(ProductInterface $product): void |
||
38 | { |
||
39 | if (false === $this->hasProduct($product)) { |
||
40 | $this->products->add($product); |
||
41 | } |
||
42 | } |
||
43 | |||
44 | public function removeProduct(ProductInterface $product): void |
||
48 | } |
||
49 | } |
||
51 |