* @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\CommandHandler; use PrestaShop\PrestaShop\Adapter\Product\ProductDeleter; use PrestaShop\PrestaShop\Core\Domain\Product\Command\DeleteProductCommand; use PrestaShop\PrestaShop\Core\Domain\Product\CommandHandler\DeleteProductHandlerInterface; /** * Handles @see DeleteProductCommand using legacy object model */ class DeleteProductHandler implements DeleteProductHandlerInterface { /** * @var ProductDeleter */ private $productDeleter; public function __construct( ProductDeleter $productDeleter ) { $this->productDeleter = $productDeleter; } /** * {@inheritdoc} */ public function handle(DeleteProductCommand $command): void { $this->productDeleter->deleteByShopConstraint( $command->getProductId(), $command->getShopConstraint() ); } }