AttributeOptionManagementInterface.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Eav\Api;
  7. /**
  8. * Interface AttributeOptionManagementInterface
  9. * @api
  10. * @since 100.0.2
  11. */
  12. interface AttributeOptionManagementInterface
  13. {
  14. /**
  15. * Add option to attribute
  16. *
  17. * @param string $attributeCode
  18. * @param int $entityType
  19. * @param \Magento\Eav\Api\Data\AttributeOptionInterface $option
  20. * @throws \Magento\Framework\Exception\StateException
  21. * @throws \Magento\Framework\Exception\InputException
  22. * @return string
  23. */
  24. public function add($entityType, $attributeCode, $option);
  25. /**
  26. * Delete option from attribute
  27. *
  28. * @param int $entityType
  29. * @param string $attributeCode
  30. * @param string $optionId
  31. * @throws \Magento\Framework\Exception\StateException
  32. * @throws \Magento\Framework\Exception\InputException
  33. * @throws \Magento\Framework\Exception\NoSuchEntityException
  34. * @return bool
  35. */
  36. public function delete($entityType, $attributeCode, $optionId);
  37. /**
  38. * Retrieve list of attribute options
  39. *
  40. * @param int $entityType
  41. * @param string $attributeCode
  42. * @throws \Magento\Framework\Exception\StateException
  43. * @throws \Magento\Framework\Exception\InputException
  44. * @return \Magento\Eav\Api\Data\AttributeOptionInterface[]
  45. */
  46. public function getItems($entityType, $attributeCode);
  47. }