TierPriceStorageInterface.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Catalog\Api;
  7. /**
  8. * Tier prices storage.
  9. * @api
  10. * @since 102.0.0
  11. */
  12. interface TierPriceStorageInterface
  13. {
  14. /**
  15. * Return product prices. In case of at least one of skus is not found exception will be thrown.
  16. *
  17. * @param string[] $skus
  18. * @return \Magento\Catalog\Api\Data\TierPriceInterface[]
  19. * @throws \Magento\Framework\Exception\NoSuchEntityException
  20. * @since 102.0.0
  21. */
  22. public function get(array $skus);
  23. /**
  24. * Add or update product prices.
  25. * If any items will have invalid price, price type, website id, sku, customer group or quantity, they will be
  26. * marked as failed and excluded from update list and \Magento\Catalog\Api\Data\PriceUpdateResultInterface[]
  27. * with problem description will be returned.
  28. * If there were no failed items during update empty array will be returned.
  29. * If error occurred during the update exception will be thrown.
  30. *
  31. * @param \Magento\Catalog\Api\Data\TierPriceInterface[] $prices
  32. * @return \Magento\Catalog\Api\Data\PriceUpdateResultInterface[]
  33. * @since 102.0.0
  34. */
  35. public function update(array $prices);
  36. /**
  37. * Remove existing tier prices and replace them with the new ones.
  38. * If any items will have invalid price, price type, website id, sku, customer group or quantity, they will be
  39. * marked as failed and excluded from replace list and \Magento\Catalog\Api\Data\PriceUpdateResultInterface[]
  40. * with problem description will be returned.
  41. * If there were no failed items during update empty array will be returned.
  42. * If error occurred during the update exception will be thrown.
  43. *
  44. * @param \Magento\Catalog\Api\Data\TierPriceInterface[] $prices
  45. * @return \Magento\Catalog\Api\Data\PriceUpdateResultInterface[]
  46. * @since 102.0.0
  47. */
  48. public function replace(array $prices);
  49. /**
  50. * Delete product tier prices.
  51. * If any items will have invalid price, price type, website id, sku, customer group or quantity, they will be
  52. * marked as failed and excluded from delete list and \Magento\Catalog\Api\Data\PriceUpdateResultInterface[]
  53. * with problem description will be returned.
  54. * If there were no failed items during update empty array will be returned.
  55. * If error occurred during the update exception will be thrown.
  56. *
  57. * @param \Magento\Catalog\Api\Data\TierPriceInterface[] $prices
  58. * @return \Magento\Catalog\Api\Data\PriceUpdateResultInterface[]
  59. * @since 102.0.0
  60. */
  61. public function delete(array $prices);
  62. }