Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
InvalidateAfterStockSourceLinksDeletePlugin.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 
39  public function afterExecute(
41  $result
42  ) {
43  $indexer = $this->indexerRegistry->get(InventoryIndexer::INDEXER_ID);
44  if ($indexer->isValid()) {
45  $indexer->invalidate();
46  }
47  }
48 }