Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ServiceClassLocator.php
Go to the documentation of this file.
1 <?php
8 
14 
20 {
24  private $serviceTypeMap;
25 
29  private $attributeRepository;
30 
34  private $complexTypeLocator;
35 
39  private $simpleTypeLocator;
40 
47  public function __construct(
48  ServiceTypeToEntityTypeMap $serviceTypeMap,
49  AttributeRepositoryInterface $attributeRepository,
50  ComplexType $complexTypeLocator,
51  SimpleType $simpleTypeLocator
52  ) {
53  $this->serviceTypeMap = $serviceTypeMap;
54  $this->attributeRepository = $attributeRepository;
55  $this->complexTypeLocator = $complexTypeLocator;
56  $this->simpleTypeLocator = $simpleTypeLocator;
57  }
58 
63  {
64  $entityCode = $this->serviceTypeMap->getEntityType($entityType);
65  if (!$entityCode) {
67  }
68 
69  $type = $this->complexTypeLocator->getType($attributeCode, $entityCode);
71  $type = $this->simpleTypeLocator->getType($attributeCode, $entityCode);
72  }
73 
74  return $type;
75  }
76 
80  public function getAllServiceDataInterfaces()
81  {
82  return $this->complexTypeLocator->getDataTypes();
83  }
84 }
$type
Definition: item.phtml:13
$attributeCode
Definition: extend.phtml:12
__construct(ServiceTypeToEntityTypeMap $serviceTypeMap, AttributeRepositoryInterface $attributeRepository, ComplexType $complexTypeLocator, SimpleType $simpleTypeLocator)