1 | <?php |
||
14 | final class CartItems implements CartItemCollection |
||
15 | { |
||
16 | /** |
||
17 | * @var \ArrayObject |
||
18 | */ |
||
19 | private $items = []; |
||
20 | |||
21 | /** |
||
22 | * @param array $items |
||
23 | */ |
||
24 | private function __construct(array $items = []) |
||
28 | |||
29 | /** |
||
30 | * @param array $items |
||
31 | * |
||
32 | * @return CartItems |
||
33 | */ |
||
34 | public static function fromArray(array $items): self |
||
38 | |||
39 | /** |
||
40 | * @return CartItemCollection |
||
41 | */ |
||
42 | public static function createEmpty(): CartItemCollection |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | public function add(CartItem $cartItem): void |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function remove(CartItem $cartItem): void |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | public function findOneByProductCode(ProductCode $productCode): CartItem |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | public function exists(CartItem $cartItem): bool |
||
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | public function findAll(): array |
||
103 | |||
104 | public function clear(): void |
||
108 | |||
109 | /** |
||
110 | * {@inheritdoc} |
||
111 | */ |
||
112 | public function getIterator(): \ArrayIterator |
||
116 | |||
117 | /** |
||
118 | * {@inheritdoc} |
||
119 | */ |
||
120 | public function count(): int |
||
124 | |||
125 | /** |
||
126 | * {@inheritdoc} |
||
127 | */ |
||
128 | public function isEmpty(): bool |
||
132 | } |
||
133 |