Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
MapperPool.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
18  private $mappers;
19 
23  protected $objectManager;
24 
29  public function __construct(
31  $mappers = []
32  ) {
33  $this->objectManager = $objectManager;
34  $this->mappers = $mappers;
35  }
36 
42  public function getMapper($entityType)
43  {
44  $className = isset($this->mappers[$entityType]) ? $this->mappers[$entityType] : MapperInterface::class;
45  return $this->objectManager->get($className);
46  }
47 }
__construct(ObjectManagerInterface $objectManager, $mappers=[])
Definition: MapperPool.php:29
if($currentSelectedMethod==$_code) $className
Definition: form.phtml:31