SpecialPriceInterface.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 prices resource model.
  9. * @api
  10. * @since 102.0.0
  11. */
  12. interface SpecialPriceInterface
  13. {
  14. /**
  15. * Get product special prices by SKUs.
  16. *
  17. * @param string[] $skus Array containing SKUs
  18. * $skus = [
  19. * 'sku value 1',
  20. * 'sku value 2'
  21. * ];
  22. * @return [
  23. * 'entity_id' => (int) Entity identified or entity link field.
  24. * 'value' => (float) Special price value.
  25. * 'store_id' => (int) Store Id.
  26. * 'sku' => (string) Product SKU.
  27. * 'price_from' => (string) Special price from date value in UTC.
  28. * 'price_to' => (string) Special price to date value in UTC.
  29. * ]
  30. * @since 101.1.0
  31. * @since 102.0.0
  32. */
  33. public function get(array $skus);
  34. /**
  35. * Update product special prices.
  36. *
  37. * @param array $prices
  38. * $prices = [
  39. * 'entity_id' => (int) Entity identified or entity link field. Required.
  40. * 'attribute_id' => (int) Special price attribute Id. Required.
  41. * 'store_id' => (int) Store Id. Required.
  42. * 'value' => (float) Special price value. Required.
  43. * 'price_from' => (string) Special price from date value in Y-m-d H:i:s format in UTC. Optional.
  44. * 'price_to' => (string) Special price to date value in Y-m-d H:i:s format in UTC. Optional.
  45. * ];
  46. * @return bool
  47. * @throws \Magento\Framework\Exception\CouldNotSaveException Thrown if error occurred during price save.
  48. * @since 102.0.0
  49. */
  50. public function update(array $prices);
  51. /**
  52. * Delete product special prices.
  53. *
  54. * @param array $prices
  55. * $prices = [
  56. * 'entity_id' => (int) Entity identified or entity link field. Required.
  57. * 'attribute_id' => (int) Special price attribute Id. Required.
  58. * 'store_id' => (int) Store Id. Required.
  59. * 'value' => (float) Special price value. Required.
  60. * 'price_from' => (string) Special price from date value in Y-m-d H:i:s format in UTC. Optional.
  61. * 'price_to' => (string) Special price to date value in Y-m-d H:i:s format in UTC. Optional.
  62. * ];
  63. * @return bool
  64. * @throws \Magento\Framework\Exception\CouldNotDeleteException Thrown if error occurred during price delete.
  65. * @since 102.0.0
  66. */
  67. public function delete(array $prices);
  68. }