Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CommandManagerPool.php
Go to the documentation of this file.
1 <?php
7 
11 
19 {
23  private $executors;
24 
29  public function __construct(
30  TMapFactory $tmapFactory,
31  array $executors = []
32  ) {
33  $this->executors = $tmapFactory->createSharedObjectsMap(
34  [
35  'array' => $executors,
36  'type' => CommandManagerInterface::class
37  ]
38  );
39  }
40 
49  public function get($paymentProviderCode)
50  {
51  if (!isset($this->executors[$paymentProviderCode])) {
52  throw new NotFoundException(
53  __('The "%1" command executor isn\'t defined. Verify the executor and try again.', $paymentProviderCode)
54  );
55  }
56 
57  return $this->executors[$paymentProviderCode];
58  }
59 }
__construct(TMapFactory $tmapFactory, array $executors=[])
__()
Definition: __.php:13