SpecialPriceStorageInterface.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. * Special price storage presents efficient price API and is used to retrieve, update or delete special prices.
  9. * @api
  10. * @since 102.0.0
  11. */
  12. interface SpecialPriceStorageInterface
  13. {
  14. /**
  15. * Return product's special price. 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\SpecialPriceInterface[]
  19. * @throws \Magento\Framework\Exception\NoSuchEntityException
  20. * @since 102.0.0
  21. */
  22. public function get(array $skus);
  23. /**
  24. * Add or update product's special price.
  25. * If any items will have invalid price, store id, sku or dates, they will be marked as failed and excluded from
  26. * update list and \Magento\Catalog\Api\Data\PriceUpdateResultInterface[] with problem description will be returned.
  27. * If there were no failed items during update empty array will be returned.
  28. * If error occurred during the update exception will be thrown.
  29. *
  30. * @param \Magento\Catalog\Api\Data\SpecialPriceInterface[] $prices
  31. * @return \Magento\Catalog\Api\Data\PriceUpdateResultInterface[]
  32. * @throws \Magento\Framework\Exception\CouldNotSaveException
  33. * @since 102.0.0
  34. */
  35. public function update(array $prices);
  36. /**
  37. * Delete product's special price.
  38. * If any items will have invalid price, store id, sku or dates, they will be marked as failed and excluded from
  39. * delete list and \Magento\Catalog\Api\Data\PriceUpdateResultInterface[] with problem description will be returned.
  40. * If there were no failed items during update empty array will be returned.
  41. * If error occurred during the delete exception will be thrown.
  42. *
  43. * @param \Magento\Catalog\Api\Data\SpecialPriceInterface[] $prices
  44. * @return \Magento\Catalog\Api\Data\PriceUpdateResultInterface[]
  45. * @throws \Magento\Framework\Exception\CouldNotDeleteException
  46. * @since 102.0.0
  47. */
  48. public function delete(array $prices);
  49. }