Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SimpleType.php
Go to the documentation of this file.
1 <?php
8 
14 
19 {
23  private $attributeRepository;
24 
28  private $serviceTypeList;
29 
35  public function __construct(
36  AttributeRepositoryInterface $attributeRepository,
37  ServiceTypeListInterface $serviceTypeList
38  ) {
39  $this->attributeRepository = $attributeRepository;
40  $this->serviceTypeList = $serviceTypeList;
41  }
42 
47  {
48  try {
49  $attribute = $this->attributeRepository->get($entityType, $attributeCode);
50  } catch (NoSuchEntityException $exception) {
52  }
53  $backendType = $attribute->getBackendType();
54  $backendTypeMap = [
61  ];
62  return isset($backendTypeMap[$backendType])
63  ? $backendTypeMap[$backendType] : TypeProcessor::NORMALIZED_ANY_TYPE;
64  }
65 
69  public function getAllServiceDataInterfaces()
70  {
71  $this->serviceTypeList->getDataTypes();
72  }
73 }
getType($attributeCode, $entityType)
Definition: SimpleType.php:46
$attributeCode
Definition: extend.phtml:12
__construct(AttributeRepositoryInterface $attributeRepository, ServiceTypeListInterface $serviceTypeList)
Definition: SimpleType.php:35