ProductAttributeOptionManagementInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 ProductAttributeOptionManagementInterface
  13. {
  14. /**
  15. * Retrieve list of attribute options
  16. *
  17. * @param string $attributeCode
  18. * @throws \Magento\Framework\Exception\StateException
  19. * @throws \Magento\Framework\Exception\InputException
  20. * @return \Magento\Eav\Api\Data\AttributeOptionInterface[]
  21. */
  22. public function getItems($attributeCode);
  23. /**
  24. * Add option to attribute
  25. *
  26. * @param string $attributeCode
  27. * @param \Magento\Eav\Api\Data\AttributeOptionInterface $option
  28. * @throws \Magento\Framework\Exception\StateException
  29. * @throws \Magento\Framework\Exception\InputException
  30. * @return string
  31. */
  32. public function add($attributeCode, $option);
  33. /**
  34. * Delete option from attribute
  35. *
  36. * @param string $attributeCode
  37. * @param string $optionId
  38. * @throws \Magento\Framework\Exception\StateException
  39. * @throws \Magento\Framework\Exception\NoSuchEntityException
  40. * @throws \Magento\Framework\Exception\InputException
  41. * @return bool
  42. */
  43. public function delete($attributeCode, $optionId);
  44. }