CostStorageInterface.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. * Product cost storage.
  9. * @api
  10. * @since 102.0.0
  11. */
  12. interface CostStorageInterface
  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\CostInterface[]
  19. * @throws \Magento\Framework\Exception\NoSuchEntityException
  20. * @since 102.0.0
  21. */
  22. public function get(array $skus);
  23. /**
  24. * Add or update product cost.
  25. * Input item should correspond to \Magento\Catalog\Api\Data\CostInterface.
  26. * If any items will have invalid cost, store id or sku, they will be marked as failed and excluded from
  27. * update list and \Magento\Catalog\Api\Data\PriceUpdateResultInterface[] 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\CostInterface[] $prices
  32. * @return \Magento\Catalog\Api\Data\PriceUpdateResultInterface[]
  33. * @since 102.0.0
  34. */
  35. public function update(array $prices);
  36. /**
  37. * Delete product cost. In case of at least one of skus is not found exception will be thrown.
  38. * If error occurred during the delete exception will be thrown.
  39. *
  40. * @param string[] $skus
  41. * @return bool Will return True if deleted.
  42. * @throws \Magento\Framework\Exception\NoSuchEntityException
  43. * @throws \Magento\Framework\Exception\CouldNotDeleteException
  44. * @since 102.0.0
  45. */
  46. public function delete(array $skus);
  47. }