Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
InvalidateAfterStockSourceLinksSavePlugin.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
13 
18 {
22  private $indexerRegistry;
23 
27  public function __construct(
28  IndexerRegistry $indexerRegistry
29  ) {
30  $this->indexerRegistry = $indexerRegistry;
31  }
32 
38  public function afterExecute(
40  $result
41  ) {
42  $indexer = $this->indexerRegistry->get(InventoryIndexer::INDEXER_ID);
43  if ($indexer->isValid()) {
44  $indexer->invalidate();
45  }
46  }
47 }