Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CompositeMapper.php
Go to the documentation of this file.
1 <?php
7 
12 {
16  private $mappers;
17 
21  public function __construct(
22  $mappers
23  ) {
24  $this->mappers = $mappers;
25  }
26 
31  {
32  foreach ($this->mappers as $mapper) {
33  $data = $mapper->entityToDatabase($entityType, $data);
34  }
35  return $data;
36  }
37 
42  {
43  foreach ($this->mappers as $mapper) {
44  $data = $mapper->databaseToEntity($entityType, $data);
45  }
46  return $data;
47  }
48 }