Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ReindexUpdatedProducts.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Catalog\Model\Product\Action as ProductAction;
9 
14 {
18  private $indexerProcessor;
19 
23  public function __construct(\Magento\CatalogInventory\Model\Indexer\Stock\Processor $indexerProcessor)
24  {
25  $this->indexerProcessor = $indexerProcessor;
26  }
27 
38  public function afterUpdateAttributes(
39  ProductAction $subject,
40  ProductAction $action,
42  ) {
43  $this->indexerProcessor->reindexList(array_unique($productIds));
44  return $action;
45  }
46 }
__construct(\Magento\CatalogInventory\Model\Indexer\Stock\Processor $indexerProcessor)
afterUpdateAttributes(ProductAction $subject, ProductAction $action, $productIds)