/** * {@inheritdoc} */ public function getAttributes($entityType, $attributeSetId) { /** @var \Magento\Eav\Api\Data\AttributeSetInterface $attributeSet */ $attributeSet = $this->setRepository->get($attributeSetId); $requiredEntityTypeId = $this->eavConfig->getEntityType($entityType)->getId(); if (!$attributeSet->getAttributeSetId() || $attributeSet->getEntityTypeId() != $requiredEntityTypeId) { throw NoSuchEntityException::singleField('attributeSetId', $attributeSetId); } $attributeCollection = $this->attributeCollection->setAttributeSetFilter($attributeSet->getAttributeSetId())->load(); return $attributeCollection->getItems(); }