Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ClientFactoryProxy.php
Go to the documentation of this file.
1 <?php
7 
10 
15 {
19  private $clientResolver;
20 
24  private $clientFactories;
25 
31  public function __construct(
32  ClientResolver $clientResolver,
33  array $clientFactories
34  ) {
35  $this->clientResolver = $clientResolver;
36  $this->clientFactories = $clientFactories;
37  }
38 
42  private function getClientFactory()
43  {
44  return $this->clientFactories[$this->clientResolver->getCurrentEngine()];
45  }
46 
50  public function create(array $options = [])
51  {
52  return $this->getClientFactory()->create($options);
53  }
54 }
__construct(ClientResolver $clientResolver, array $clientFactories)