* @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\Core\Domain\CustomerService\CommandHandler; use PrestaShop\PrestaShop\Core\Domain\CustomerService\Command\BulkDeleteCustomerThreadCommand; use PrestaShop\PrestaShop\Core\Domain\CustomerService\Repository\CustomerThreadRepository; /** * Handles command for customer thread bulk deletion */ class BulkDeleteCustomerThreadHandler implements BulkDeleteCustomerThreadHandlerInterface { /** * @var CustomerThreadRepository */ private $customerThreadRepository; public function __construct(CustomerThreadRepository $customerThreadRepository) { $this->customerThreadRepository = $customerThreadRepository; } public function handle(BulkDeleteCustomerThreadCommand $command): void { foreach ($command->getCustomerThreadIds() as $customerThreadId) { $this->customerThreadRepository->delete($customerThreadId); } } }