OptionRepositoryInterface.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\ConfigurableProduct\Api;
  8. /**
  9. * Manage options of configurable product
  10. *
  11. * @api
  12. * @since 100.0.2
  13. */
  14. interface OptionRepositoryInterface
  15. {
  16. /**
  17. * Get option for configurable product
  18. *
  19. * @param string $sku
  20. * @param int $id
  21. * @return \Magento\ConfigurableProduct\Api\Data\OptionInterface
  22. * @throws \Magento\Framework\Exception\NoSuchEntityException
  23. * @throws \Magento\Framework\Exception\InputException
  24. */
  25. public function get($sku, $id);
  26. /**
  27. * Get all options for configurable product
  28. *
  29. * @param string $sku
  30. * @return \Magento\ConfigurableProduct\Api\Data\OptionInterface[]
  31. * @throws \Magento\Framework\Exception\NoSuchEntityException
  32. * @throws \Magento\Framework\Exception\InputException
  33. */
  34. public function getList($sku);
  35. /**
  36. * Remove option from configurable product
  37. *
  38. * @param \Magento\ConfigurableProduct\Api\Data\OptionInterface $option
  39. * @return bool
  40. */
  41. public function delete(\Magento\ConfigurableProduct\Api\Data\OptionInterface $option);
  42. /**
  43. * Remove option from configurable product
  44. *
  45. * @param string $sku
  46. * @param int $id
  47. * @return bool
  48. * @throws \Magento\Framework\Exception\NoSuchEntityException
  49. * @throws \Magento\Framework\Exception\InputException
  50. */
  51. public function deleteById($sku, $id);
  52. /**
  53. * Save option
  54. *
  55. * @param string $sku
  56. * @param \Magento\ConfigurableProduct\Api\Data\OptionInterface $option
  57. * @return int
  58. * @throws \Magento\Framework\Exception\NoSuchEntityException
  59. * @throws \Magento\Framework\Exception\CouldNotSaveException
  60. * @throws \InvalidArgumentException
  61. */
  62. public function save($sku, \Magento\ConfigurableProduct\Api\Data\OptionInterface $option);
  63. }