1 | <?php |
||
19 | class ProductBundleManipulator implements ProductBundleManipulatorInterface |
||
20 | { |
||
21 | /** @var FactoryInterface */ |
||
22 | private $productBundleSlotFactory; |
||
23 | |||
24 | /** @var ProductBundleInterface */ |
||
25 | private $productBundle; |
||
26 | |||
27 | public function __construct(FactoryInterface $productBundleSlotFactory) |
||
31 | |||
32 | public function setProductBundle(ProductBundleInterface $productBundle): void |
||
36 | |||
37 | public function getProductBundle(): ?ProductBundleInterface |
||
41 | |||
42 | /** |
||
43 | * @param ProductInterface[] $products |
||
44 | */ |
||
45 | public function addSlot( |
||
57 | |||
58 | private function createSlot(string $slotName): ProductBundleSlotInterface |
||
66 | |||
67 | private function applyOptionsToSlot( |
||
78 | |||
79 | private function addSlotToBundle(ProductBundleSlotInterface $slot): void |
||
83 | |||
84 | private function setPresentationSlotOnBundle(ProductBundleSlotInterface $slot): void |
||
88 | |||
89 | /** |
||
90 | * @param ProductInterface[] $products |
||
91 | */ |
||
92 | private function addProductsToSlot(array $products, ProductBundleSlotInterface $slot): void |
||
98 | |||
99 | private function addProductToSlot(ProductInterface $product, ProductBundleSlotInterface $slot): void |
||
103 | |||
104 | private function hasPositionOption(?ProductBundleSlotOptionsInterface $options): bool |
||
108 | |||
109 | private function shouldSetAsPresentationSlot(?ProductBundleSlotOptionsInterface $options): bool |
||
113 | } |
||
114 |