24 private $customerDataObjectMethods;
29 private $attributeMetadataConverter;
34 private $attributeMetadataDataProvider;
44 $this->attributeMetadataConverter = $attributeMetadataConverter;
45 $this->attributeMetadataDataProvider = $attributeMetadataDataProvider;
54 $attributesFormCollection = $this->attributeMetadataDataProvider->loadAttributesCollection(
55 self::ENTITY_TYPE_CUSTOMER,
58 foreach ($attributesFormCollection as
$attribute) {
77 $attributeMetadata = $this->attributeMetadataConverter->createMetadataAttribute(
$attribute);
78 return $attributeMetadata;
80 throw new NoSuchEntityException(
82 'No such entity with %fieldName = %fieldValue, %field2Name = %field2Value',
84 'fieldName' =>
'entityType',
85 'fieldValue' => self::ENTITY_TYPE_CUSTOMER,
86 'field2Name' =>
'attributeCode',
100 $attributeCodes = $this->attributeMetadataDataProvider->getAllAttributeCodes(
101 self::ENTITY_TYPE_CUSTOMER,
102 self::ATTRIBUTE_SET_ID_CUSTOMER
105 $attributesMetadata = [];
110 }
catch (NoSuchEntityException $e) {
115 return $attributesMetadata;
123 $customAttributes = [];
124 if (!$this->customerDataObjectMethods) {
125 $dataObjectMethods = array_flip(get_class_methods($dataObjectClassName));
126 $baseClassDataObjectMethods = array_flip(
127 get_class_methods(\
Magento\Framework\Api\AbstractExtensibleObject::class)
129 $this->customerDataObjectMethods = array_diff_key($dataObjectMethods, $baseClassDataObjectMethods);
134 $isDataObjectMethod = isset($this->customerDataObjectMethods[
'get' . $camelCaseKey])
135 || isset($this->customerDataObjectMethods[
'is' . $camelCaseKey]);
138 if (!$isDataObjectMethod
139 && (!$attributeMetadata->isSystem() ||
$attributeCode ==
'disable_auto_group_change')
141 $customAttributes[] = $attributeMetadata;
144 return $customAttributes;
static snakeCaseToUpperCamelCase($input)
static singleField($fieldName, $fieldValue)