24 private $moduleDataSetup;
29 private $stockConfiguration;
34 private $storeManager;
39 private $indexerProcessor;
50 \
Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration,
51 \
Magento\Store\Model\StoreManagerInterface $storeManager,
54 $this->moduleDataSetup = $moduleDataSetup;
55 $this->stockConfiguration = $stockConfiguration;
65 $this->moduleDataSetup->getConnection()->update(
66 $this->moduleDataSetup->getTable(
'cataloginventory_stock_item'),
67 [
'website_id' => $this->stockConfiguration->getDefaultScopeId()],
68 [
'website_id = ?' => $this->storeManager->getWebsite()->getId()]
70 $this->indexerProcessor->getIndexer()->invalidate();
79 CreateDefaultStock::class,
__construct(ModuleDataSetupInterface $moduleDataSetup, \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration, \Magento\Store\Model\StoreManagerInterface $storeManager, Processor $indexerProcessor)