PHP Class Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Indexer\Fulltext\Datasource\InventoryData

Author: Romain Ruaud ([email protected])
Inheritance: extends Smile\ElasticsuiteCatalog\Model\ResourceModel\Eav\Indexer\Indexer
Mostra file Open project: smile-sa/elasticsuite Class Usage Examples

Public Methods

Method Description
__construct ( Magento\Framework\App\ResourceConnection $resource, Magento\Store\Model\StoreManagerInterface $storeManager, Magento\Framework\EntityManager\MetadataPool $metadataPool, Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration ) InventoryData constructor.
loadInventoryData ( integer $storeId, array $productIds ) : array Load inventory data for a list of product ids and a given store.

Private Methods

Method Description
getStockId ( integer $websiteId ) : integer Retrieve stock_id by store
getWebsiteId ( integer $storeId ) : integer Retrieve Website Id by Store Id

Method Details

__construct() public method

InventoryData constructor.
public __construct ( Magento\Framework\App\ResourceConnection $resource, Magento\Store\Model\StoreManagerInterface $storeManager, Magento\Framework\EntityManager\MetadataPool $metadataPool, Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration )
$resource Magento\Framework\App\ResourceConnection Database adapter.
$storeManager Magento\Store\Model\StoreManagerInterface Store manager.
$metadataPool Magento\Framework\EntityManager\MetadataPool Metadata Pool
$stockRegistry Magento\CatalogInventory\Api\StockRegistryInterface Stock registry.
$stockConfiguration Magento\CatalogInventory\Api\StockConfigurationInterface Stock configuration.

loadInventoryData() public method

Load inventory data for a list of product ids and a given store.
public loadInventoryData ( integer $storeId, array $productIds ) : array
$storeId integer Store id.
$productIds array Product ids list.
return array