Model
StockRegistry
Magento\CatalogInventory\Model\StockRegistry
What it does
This class serves as a central registry for managing inventory stock data in Magento 2.
Developers use it to retrieve stock items, stock status, and low stock information for products either by product ID or SKU.
It acts as a facade that delegates actual data retrieval to stock registry providers while handling product ID resolution and scope management.
Public Methods
- getStock()
- getStockItem()
- getStockItemBySku()
- getStockStatus()
- getStockStatusBySku()
- getProductStockStatus()
- getProductStockStatusBySku()
- getLowStockItems()
- updateStockItemBySku()