AttributeManagementInterface.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Eav\Api;
  8. /**
  9. * Interface AttributeManagementInterface
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface AttributeManagementInterface
  14. {
  15. /**
  16. * Assign attribute to attribute set
  17. *
  18. * @param string $entityTypeCode
  19. * @param int $attributeSetId
  20. * @param int $attributeGroupId
  21. * @param string $attributeCode
  22. * @param int $sortOrder
  23. * @return int
  24. * @throws \Magento\Framework\Exception\InputException
  25. * @throws \Magento\Framework\Exception\NoSuchEntityException
  26. */
  27. public function assign($entityTypeCode, $attributeSetId, $attributeGroupId, $attributeCode, $sortOrder);
  28. /**
  29. * Remove attribute from attribute set
  30. *
  31. * @param string $attributeSetId
  32. * @param string $attributeCode
  33. * @throws \Magento\Framework\Exception\InputException
  34. * @throws \Magento\Framework\Exception\NoSuchEntityException
  35. * @throws \Magento\Framework\Exception\StateException
  36. * @return bool
  37. */
  38. public function unassign($attributeSetId, $attributeCode);
  39. /**
  40. * Retrieve related attributes based on given attribute set ID
  41. *
  42. * @param string $entityTypeCode
  43. * @param string $attributeSetId
  44. * @throws \Magento\Framework\Exception\NoSuchEntityException If $attributeSetId is not found
  45. * @return \Magento\Eav\Api\Data\AttributeInterface[]
  46. */
  47. public function getAttributes($entityTypeCode, $attributeSetId);
  48. }