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