Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ExchangeFactory.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Framework\Amqp;
7 
15 {
21  private $objectManager = null;
22 
28  private $instanceName = null;
29 
33  private $configPool;
34 
43  public function __construct(
44  \Magento\Framework\ObjectManagerInterface $objectManager,
45  ConfigPool $configPool,
46  $instanceName = \Magento\Framework\Amqp\Exchange::class
47  ) {
48  $this->objectManager = $objectManager;
49  $this->configPool = $configPool;
50  $this->instanceName = $instanceName;
51  }
52 
57  public function create($connectionName, array $data = [])
58  {
59  $data['amqpConfig'] = $this->configPool->get($connectionName);
60  return $this->objectManager->create(
61  $this->instanceName,
62  $data
63  );
64  }
65 }
$objectManager
Definition: bootstrap.php:17
__construct(\Magento\Framework\ObjectManagerInterface $objectManager, ConfigPool $configPool, $instanceName=\Magento\Framework\Amqp\Exchange::class)
create($connectionName, array $data=[])