ProductAttributeManagementInterface.php 1.4 KB

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