Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RecurringData.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Indexer\Setup;
8 
9 use Magento\Framework\Indexer\IndexerInterfaceFactory;
14 
19 {
23  private $indexerFactory;
24 
28  private $configInterface;
29 
36  public function __construct(
37  IndexerInterfaceFactory $indexerFactory,
38  ConfigInterface $configInterface
39  ) {
40  $this->indexerFactory = $indexerFactory;
41  $this->configInterface = $configInterface;
42  }
43 
48  {
49  foreach (array_keys($this->configInterface->getIndexers()) as $indexerId) {
50  $indexer = $this->indexerFactory->create()->load($indexerId);
51  if ($indexer->isScheduled()) {
52  $indexer->getView()->unsubscribe()->subscribe();
53  }
54  }
55  }
56 }
install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
$setup
Definition: trigger.php:12
__construct(IndexerInterfaceFactory $indexerFactory, ConfigInterface $configInterface)