StockStateInterface.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\CatalogInventory\Api;
  7. /**
  8. * Interface StockStateInterface
  9. * @api
  10. * @since 100.0.2
  11. *
  12. * @deprecated 100.3.0 Replaced with Multi Source Inventory
  13. * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html
  14. * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html
  15. */
  16. interface StockStateInterface
  17. {
  18. /**
  19. * @param int $productId
  20. * @param int $scopeId
  21. * @return bool
  22. */
  23. public function verifyStock($productId, $scopeId = null);
  24. /**
  25. * @param int $productId
  26. * @param int $scopeId
  27. * @return bool
  28. */
  29. public function verifyNotification($productId, $scopeId = null);
  30. /**
  31. * @param int $productId
  32. * @param float $itemQty
  33. * @param float $qtyToCheck
  34. * @param float $origQty
  35. * @param int $scopeId
  36. * @return int
  37. */
  38. public function checkQuoteItemQty($productId, $itemQty, $qtyToCheck, $origQty, $scopeId = null);
  39. /**
  40. * Check quantity
  41. *
  42. * @param int $productId
  43. * @param float $qty
  44. * @param int $scopeId
  45. * @throws \Magento\Framework\Exception\LocalizedException
  46. * @return bool
  47. */
  48. public function checkQty($productId, $qty, $scopeId = null);
  49. /**
  50. * Returns suggested qty that satisfies qty increments and minQty/maxQty/minSaleQty/maxSaleQty conditions
  51. * or original qty if such value does not exist
  52. *
  53. * @param int $productId
  54. * @param float $qty
  55. * @param int $scopeId
  56. * @return float
  57. */
  58. public function suggestQty($productId, $qty, $scopeId = null);
  59. /**
  60. * Retrieve stock qty whether product is composite or no
  61. *
  62. * @param int $productId
  63. * @param int $scopeId
  64. * @return float
  65. */
  66. public function getStockQty($productId, $scopeId = null);
  67. }