* @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\Store\CommandHandler; use PrestaShop\PrestaShop\Core\Domain\Store\Command\BulkDeleteStoreCommand; use PrestaShop\PrestaShop\Core\Domain\Store\CommandHandler\BulkDeleteStoreHandlerInterface; use PrestaShop\PrestaShop\Core\Domain\Store\Repository\StoreRepository; /** * Handles command that deletes stores */ class BulkDeleteStoreHandler implements BulkDeleteStoreHandlerInterface { /** * @var StoreRepository */ private $storeRepository; public function __construct(StoreRepository $storeRepository) { $this->storeRepository = $storeRepository; } /** * {@inheritdoc} */ public function handle(BulkDeleteStoreCommand $command): void { foreach ($command->getStoreIds() as $storeId) { $this->storeRepository->delete($storeId); } } }