|
- <?php
-
- namespace domain\Product\RotatingProduct;
-
- use domain\_\AbstractManager;
- use domain\_\StatusInterface;
- use domain\Product\Product\Product;
- use domain\Product\Rotating\Rotating;
-
- class RotatingProductManager extends AbstractManager
- {
- protected RotatingProductBuilder $rotatingProductBuilder;
-
- public function loadDependencies(): void
- {
- $this->rotatingProductBuilder = $this->loadService(RotatingProductBuilder::class);
- }
-
- public function createRotatingProduct(Rotating $rotating, Product $product): RotatingProduct
- {
- $rotatingProduct = $this->rotatingProductBuilder->instanciateRotatingProduct($rotating);
- $rotatingProduct->setProduct($product);
- $this->rotatingProductBuilder->initRotatingProductPosition($rotatingProduct);
- $rotatingProduct->save();
-
- return $rotatingProduct;
- }
- }
|