/** * @param int $idProductAbstract * @param \Generated\Shared\Transfer\ProductImageSetTransfer $productImagesSet * * @return void */ protected function saveProductImageSet($idProductAbstract, $productImagesSet) { $this->productQueryContainer->getConnection()->beginTransaction(); $productImageSetEntity = new SpyProductImageSet(); $productImageSetEntity->setFkProductAbstract($idProductAbstract); $productImageSetEntity->setName($productImagesSet->getName()); $productImageSetEntity->setFkLocale($productImagesSet->getLocale()->getIdLocale()); $productImageSetEntity->save(); $idProductImageSet = $productImageSetEntity->getIdProductImageSet(); foreach ($productImagesSet->getProductImages() as $productImage) { $this->saveProductImage($idProductImageSet, $productImage); } $this->productQueryContainer->getConnection()->commit(); }