/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/MessageQueue/Bulk/ExchangeRepository.php
48 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2018 Adobe * All Rights Reserved. */ namespace Magento\Framework\MessageQueue\Bulk; /** * Used to get exchange instance from the pool. */ class ExchangeRepository { /** * @var ExchangeFactoryInterface */ private $exchangeFactory; /** * Pool of exchange instances. * * @var ExchangeInterface[] */ private $exchangePool = []; /** * @param ExchangeFactoryInterface $exchangeFactory */ public function __construct(ExchangeFactoryInterface $exchangeFactory) { $this->exchangeFactory = $exchangeFactory; } /** * Get exchange from the pool for the specified connection type. * * @param string $connectionName * @return ExchangeInterface * @throws \LogicException */ public function getByConnectionName($connectionName) { if (!isset($this->exchangePool[$connectionName])) { $exchange = $this->exchangeFactory->create($connectionName); $this->exchangePool[$connectionName] = $exchange; } return $this->exchangePool[$connectionName]; } }