Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CustomizableOptionTypeResolver.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
12 
17 {
18  const ENTITY_TYPE = 'customizable_options';
19 
23  private $mapper;
24 
28  public function __construct(MapperInterface $mapper)
29  {
30  $this->mapper = $mapper;
31  }
32 
36  public function resolveType(array $data) : string
37  {
38  $map = $this->mapper->getMappedTypes(self::ENTITY_TYPE);
39  if (isset($map[$data['type']])) {
40  return $map[$data['type']];
41  }
42  return '';
43  }
44 }