Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ExchangeRepository.php
Go to the documentation of this file.
1 <?php
7 
12 {
16  private $exchangeFactory;
17 
23  private $exchangePool = [];
24 
28  public function __construct(ExchangeFactoryInterface $exchangeFactory)
29  {
30  $this->exchangeFactory = $exchangeFactory;
31  }
32 
40  public function getByConnectionName($connectionName)
41  {
42  if (!isset($this->exchangePool[$connectionName])) {
43  $exchange = $this->exchangeFactory->create($connectionName);
44  $this->exchangePool[$connectionName] = $exchange;
45  }
46  return $this->exchangePool[$connectionName];
47  }
48 }
__construct(ExchangeFactoryInterface $exchangeFactory)