Model
StockRegistryPreloader
Magento\CatalogInventory\Model\StockRegistryPreloader
What it does
This class optimizes database queries by preloading stock inventory data (quantities and availability status) for multiple products at once into Magento's stock registry cache.
Developers use this when displaying product lists or collections to avoid N+1 query problems by batch-loading stock information for all products upfront instead of querying each product individually.
Public Methods
- preloadStockItems()
- setStockItems()
- preloadStockStatuses()
- setStockStatuses()