StockRegistryInterface.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 StockRegistryInterface
  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 StockRegistryInterface
  17. {
  18. /**
  19. * @param int $scopeId
  20. * @return \Magento\CatalogInventory\Api\Data\StockInterface
  21. */
  22. public function getStock($scopeId = null);
  23. /**
  24. * @param int $productId
  25. * @param int $scopeId
  26. * @return \Magento\CatalogInventory\Api\Data\StockItemInterface
  27. */
  28. public function getStockItem($productId, $scopeId = null);
  29. /**
  30. * @param string $productSku
  31. * @param int $scopeId
  32. * @return \Magento\CatalogInventory\Api\Data\StockItemInterface
  33. * @throws \Magento\Framework\Exception\NoSuchEntityException
  34. */
  35. public function getStockItemBySku($productSku, $scopeId = null);
  36. /**
  37. * @param int $productId
  38. * @param int $scopeId
  39. * @return \Magento\CatalogInventory\Api\Data\StockStatusInterface
  40. */
  41. public function getStockStatus($productId, $scopeId = null);
  42. /**
  43. * @param string $productSku
  44. * @param int $scopeId
  45. * @return \Magento\CatalogInventory\Api\Data\StockStatusInterface
  46. * @throws \Magento\Framework\Exception\NoSuchEntityException
  47. */
  48. public function getStockStatusBySku($productSku, $scopeId = null);
  49. /**
  50. * Retrieve Product stock status
  51. *
  52. * @param int $productId
  53. * @param int $scopeId
  54. * @return int
  55. */
  56. public function getProductStockStatus($productId, $scopeId = null);
  57. /**
  58. * @param string $productSku
  59. * @param int $scopeId
  60. * @return int
  61. * @throw \Magento\Framework\Exception\NoSuchEntityException
  62. */
  63. public function getProductStockStatusBySku($productSku, $scopeId = null);
  64. /**
  65. * Retrieves a list of SKU's with low inventory qty
  66. *
  67. * @param int $scopeId
  68. * @param float $qty
  69. * @param int $currentPage
  70. * @param int $pageSize
  71. * @return \Magento\CatalogInventory\Api\Data\StockItemCollectionInterface
  72. */
  73. public function getLowStockItems($scopeId, $qty, $currentPage = 1, $pageSize = 0);
  74. /**
  75. * @param string $productSku
  76. * @param \Magento\CatalogInventory\Api\Data\StockItemInterface $stockItem
  77. * @return int
  78. * @throws \Magento\Framework\Exception\NoSuchEntityException
  79. */
  80. public function updateStockItemBySku($productSku, \Magento\CatalogInventory\Api\Data\StockItemInterface $stockItem);
  81. }