Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
GridAsyncInsert Class Reference

Public Member Functions

 __construct (\Magento\Sales\Model\ResourceModel\GridInterface $entityGrid, \Magento\Framework\App\Config\ScopeConfigInterface $globalConfig)
 
 asyncInsert ()
 

Protected Attributes

 $entityGrid
 
 $globalConfig
 

Detailed Description

Sales entity grids indexing observer.

Performs handling of events and cron jobs related to indexing of Order, Invoice, Shipment and Creditmemo grids.

Definition at line 14 of file GridAsyncInsert.php.

Constructor & Destructor Documentation

◆ __construct()

Parameters
\Magento\Sales\Model\ResourceModel\GridInterface$entityGrid
\Magento\Framework\App\Config\ScopeConfigInterface$globalConfig

Definition at line 34 of file GridAsyncInsert.php.

37  {
38  $this->entityGrid = $entityGrid;
39  $this->globalConfig = $globalConfig;
40  }

Member Function Documentation

◆ asyncInsert()

asyncInsert ( )

Handles asynchronous insertion of the new entity into corresponding grid during cron job.

Also method is used in the next events:

  • config_data_dev_grid_async_indexing_disabled

Works only if asynchronous grid indexing is enabled in global settings.

Returns
void

Definition at line 55 of file GridAsyncInsert.php.

56  {
57  if ($this->globalConfig->getValue('dev/grid/async_indexing')) {
58  $this->entityGrid->refreshBySchedule();
59  }
60  }

Field Documentation

◆ $entityGrid

$entityGrid
protected

Definition at line 21 of file GridAsyncInsert.php.

◆ $globalConfig

$globalConfig
protected

Definition at line 28 of file GridAsyncInsert.php.


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