* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ declare(strict_types=1); namespace PrestaShop\PrestaShop\Adapter\Product\Image\CommandHandler; use PrestaShop\PrestaShop\Adapter\Product\Image\Update\ProductImageUpdater; use PrestaShop\PrestaShop\Core\Domain\Product\Image\Command\DeleteProductImageCommand; use PrestaShop\PrestaShop\Core\Domain\Product\Image\CommandHandler\DeleteProductImageHandlerInterface; /** * Handles @see DeleteProductImageCommand */ class DeleteProductImageHandler implements DeleteProductImageHandlerInterface { /** * @var ProductImageUpdater */ private $productImageUpdater; public function __construct( ProductImageUpdater $productImageUpdater ) { $this->productImageUpdater = $productImageUpdater; } /** * {@inheritDoc} */ public function handle(DeleteProductImageCommand $command): void { $this->productImageUpdater->deleteImage($command->getImageId()); } }