/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Stomp/StompClientProvider.php
52 строки
1 KB
Dmytro Horytskyi
ACP2E-4349: [B2B] Purchase orders not auto-converting to sales order with ActiveMQ
13 май 2026, 09:27
13 май 2026, 09:27
2e4a4eb
Код
Авторство
О чём код?
<?php /** * Copyright 2026 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Framework\Stomp; use Magento\Framework\ObjectManager\ResetAfterRequestInterface; class StompClientProvider implements ResetAfterRequestInterface { /** * @var StompClientInterface[] */ private array $stompClients = []; /** * @param ConfigPool $configPool * @param StompClientFactory $stompClientFactory */ public function __construct( private readonly ConfigPool $configPool, private readonly StompClientFactory $stompClientFactory, ) { } /** * Get stomp client by connection name. * * @param string $connectionName * @return StompClientInterface */ public function get(string $connectionName = Config::STOMP_CONFIG): StompClientInterface { if (!isset($this->stompClients[$connectionName])) { $stompConfig = $this->configPool->get($connectionName); $this->stompClients[$connectionName] = $this->stompClientFactory->create(['stompConfig' => $stompConfig]); } return $this->stompClients[$connectionName]; } /** * @inheritdoc */ public function _resetState(): void { $this->stompClients = []; } }