Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
RecurringData Class Reference
Inheritance diagram for RecurringData:
InstallDataInterface

Public Member Functions

 __construct (IndexerInterfaceFactory $indexerFactory, ConfigInterface $configInterface)
 
 install (ModuleDataSetupInterface $setup, ModuleContextInterface $context)
 

Detailed Description

Recurring data upgrade for indexer module

Definition at line 18 of file RecurringData.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( IndexerInterfaceFactory  $indexerFactory,
ConfigInterface  $configInterface 
)

RecurringData constructor.

Parameters
IndexerInterfaceFactory$indexerFactory
ConfigInterface$configInterface

Definition at line 36 of file RecurringData.php.

39  {
40  $this->indexerFactory = $indexerFactory;
41  $this->configInterface = $configInterface;
42  }

Member Function Documentation

◆ install()

install ( ModuleDataSetupInterface  $setup,
ModuleContextInterface  $context 
)

{Installs data for a module

Parameters
ModuleDataSetupInterface$setup
ModuleContextInterface$context
Returns
void
}

Implements InstallDataInterface.

Definition at line 47 of file RecurringData.php.

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  }

The documentation for this class was generated from the following file: