Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

RotatingProductManager.php 861B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace domain\Product\RotatingProduct;
  3. use domain\_\AbstractManager;
  4. use domain\_\StatusInterface;
  5. use domain\Product\Product\Product;
  6. use domain\Product\Rotating\Rotating;
  7. class RotatingProductManager extends AbstractManager
  8. {
  9. protected RotatingProductBuilder $rotatingProductBuilder;
  10. public function loadDependencies(): void
  11. {
  12. $this->rotatingProductBuilder = $this->loadService(RotatingProductBuilder::class);
  13. }
  14. public function createRotatingProduct(Rotating $rotating, Product $product): RotatingProduct
  15. {
  16. $rotatingProduct = $this->rotatingProductBuilder->instanciateRotatingProduct($rotating);
  17. $rotatingProduct->setProduct($product);
  18. $this->rotatingProductBuilder->initRotatingProductPosition($rotatingProduct);
  19. $rotatingProduct->save();
  20. return $rotatingProduct;
  21. }
  22. }