59 private $attributeCollectionFactory;
101 }
catch (NoSuchEntityException $ex) {
102 throw new NoSuchEntityException(
104 'The AttributeSet with a "%1" ID doesn\'t exist. Verify the attributeSet and try again.',
110 $setEntityType = $this->entityTypeFactory->create()->getEntityType(
$attributeSet->getEntityTypeId());
112 throw new InputException(
__(
'The attribute set ID is incorrect. Verify the ID and try again.'));
119 throw new InputException(
__(
'The attribute group doesn\'t belong to the attribute set.'));
125 $this->attributeResource->saveInSetIncluding(
133 return $attribute->loadEntityAttributeIdBySet()->getData(
'entity_attribute_id');
143 }
catch (NoSuchEntityException $e) {
144 throw new NoSuchEntityException(
145 __(
'The "%1" attribute set wasn\'t found. Verify and try again.',
$attributeSetId)
148 $setEntityType = $this->entityTypeFactory->create()->getEntityType(
$attributeSet->getEntityTypeId());
158 throw new InputException(
160 'The "%1" attribute wasn\'t found in the "%2" attribute set. Enter the attribute and try again.',
167 throw new StateException(
__(
"The system attribute can't be deleted."));
180 $requiredEntityTypeId = $this->eavConfig->getEntityType(
$entityType)->getId();
getAttributes($entityTypeCode, $attributeSetId)
unassign($attributeSetId, $attributeCode)
static singleField($fieldName, $fieldValue)
assign($entityTypeCode, $attributeSetId, $attributeGroupId, $attributeCode, $sortOrder)
__construct(\Magento\Eav\Api\AttributeSetRepositoryInterface $setRepository, \Magento\Eav\Model\ResourceModel\Entity\Attribute\Collection $attributeCollection, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\ConfigFactory $entityTypeFactory, \Magento\Eav\Api\AttributeGroupRepositoryInterface $groupRepository, \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository, \Magento\Eav\Model\ResourceModel\Entity\Attribute $attributeResource, \Magento\Eav\Model\ResourceModel\Entity\Attribute\CollectionFactory $attributeCollectionFactory=null)