24 private $stringUtility;
29 private $attributeRepository;
34 private $backendModelToAttributeTypeMap;
47 array $backendModelToAttributeTypeMap
49 $this->stringUtility = $stringUtility;
51 $this->backendModelToAttributeTypeMap = $backendModelToAttributeTypeMap;
65 $attributeTypeMap = $this->getAttributeBackendModelToTypeMapping();
67 if (empty($backendModel)
71 $backendModelClass = sprintf(
72 'Magento\Eav\Model\Attribute\Data\%s',
73 $this->stringUtility->upperCaseWords(
$attribute->getFrontendInput())
75 $backendModel =
class_exists($backendModelClass) ? $backendModelClass :
null;
78 $dataInterface = isset($attributeTypeMap[$backendModel])
79 ? $attributeTypeMap[$backendModel]
82 return $dataInterface;
90 $dataInterfaceArray = [];
91 foreach ($this->getAttributeBackendModelToTypeMapping() as $attributeType) {
92 if (interface_exists($attributeType)) {
93 $dataInterfaceArray[] = $attributeType;
96 return array_unique($dataInterfaceArray);
110 private function getAttributeBackendModelToTypeMapping()
112 $attributeTypeMap = [];
113 foreach ($this->backendModelToAttributeTypeMap as $key =>
$value) {
116 foreach (
$value as $backendModel => $attributeType) {
117 $attributeTypeMap[$backendModel] = $attributeType;
120 $attributeTypeMap[$key] =
$value;
123 return $attributeTypeMap;
getType($attributeCode, $entityType)
__construct(StringUtils $stringUtility, AttributeRepositoryInterface $attributeRepository, array $backendModelToAttributeTypeMap)
const NORMALIZED_ANY_TYPE
getAllServiceDataInterfaces()