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; } }