Model

Item

Magento\CatalogInventory\Model\ResourceModel\Stock\Item

What it does

This resource model manages database operations for catalog inventory stock items in Magento 2.

Developers use it to load stock data by product ID, update stock statuses (in/out of stock), manage low stock dates, and handle quantity corrections.

It also triggers reindexing for stock and price indexes when inventory data changes, ensuring product availability and pricing are kept in sync across the catalog.

Public Methods

  • loadByProductId()
  • setProcessIndexEvents()
  • updateSetOutOfStock()
  • updateSetInStock()
  • updateLowStockDate()
  • getManageStockExpr()
  • getBackordersExpr()
  • getMinSaleQtyExpr()