StockStateProviderInterface.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\CatalogInventory\Model\Spi;
  7. use Magento\CatalogInventory\Api\Data\StockItemInterface;
  8. /**
  9. * Interface StockStateProviderInterface
  10. */
  11. interface StockStateProviderInterface
  12. {
  13. /**
  14. * @param StockItemInterface $stockItem
  15. * @return bool
  16. */
  17. public function verifyStock(StockItemInterface $stockItem);
  18. /**
  19. * @param StockItemInterface $stockItem
  20. * @return bool
  21. */
  22. public function verifyNotification(StockItemInterface $stockItem);
  23. /**
  24. * @param StockItemInterface $stockItem
  25. * @param int|float $itemQty
  26. * @param int|float $qtyToCheck
  27. * @param int|float $origQty
  28. * @return int
  29. */
  30. public function checkQuoteItemQty(StockItemInterface $stockItem, $itemQty, $qtyToCheck, $origQty = 0);
  31. /**
  32. * Check quantity
  33. *
  34. * @param StockItemInterface $stockItem
  35. * @param int|float $qty
  36. * @exception \Magento\Framework\Exception\LocalizedException
  37. * @return bool
  38. */
  39. public function checkQty(StockItemInterface $stockItem, $qty);
  40. /**
  41. * Returns suggested qty that satisfies qty increments and minQty/maxQty/minSaleQty/maxSaleQty conditions
  42. * or original qty if such value does not exist
  43. *
  44. * @param StockItemInterface $stockItem
  45. * @param int|float $qty
  46. * @return int|float
  47. */
  48. public function suggestQty(StockItemInterface $stockItem, $qty);
  49. /**
  50. * @param StockItemInterface $stockItem
  51. * @param int|float $qty
  52. * @return \Magento\Framework\DataObject
  53. */
  54. public function checkQtyIncrements(StockItemInterface $stockItem, $qty);
  55. /**
  56. * Retrieve stock qty whether product is composite or no
  57. *
  58. * @param StockItemInterface $stockItem
  59. * @return float
  60. */
  61. public function getStockQty(StockItemInterface $stockItem);
  62. }