1 | <?php |
||
17 | class ProductBundleCreator implements ProductBundleCreatorInterface |
||
18 | { |
||
19 | /** @var FactoryInterface */ |
||
20 | private $productBundleFactory; |
||
21 | |||
22 | /** @var FactoryInterface */ |
||
23 | private $productBundleSlotFactory; |
||
24 | |||
25 | /** @var ProductBundleInterface */ |
||
26 | private $productBundle; |
||
27 | |||
28 | public function __construct( |
||
35 | |||
36 | public function createProductBundle(string $productBundleName, ProductInterface $productBundleProduct): self |
||
44 | |||
45 | public function getProductBundle(): ProductBundleInterface |
||
49 | |||
50 | /** |
||
51 | * @param string $slotName |
||
52 | * @param array $options |
||
53 | * @param ProductInterface[] $products |
||
54 | * |
||
55 | * @return ProductBundleCreator |
||
56 | */ |
||
57 | public function addSlot(string $slotName, array $options = [], array $products = []): self |
||
68 | |||
69 | private function applyOptionsToSlot(array $options, ProductBundleSlotInterface $slot): void |
||
75 | |||
76 | private function addProductsToSlot(array $products, ProductBundleSlotInterface $slot): void |
||
82 | |||
83 | private function addProductToSlot(ProductInterface $product, ProductBundleSlotInterface $slot): void |
||
87 | |||
88 | private function addSlotToBundle(array $options, $slot): void |
||
95 | |||
96 | private function createSlot(string $slotName): ProductBundleSlotInterface |
||
105 | } |
||
106 |