Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
GridAsyncInsert.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Sales\Model;
7 
15 {
21  protected $entityGrid;
22 
28  protected $globalConfig;
29 
34  public function __construct(
35  \Magento\Sales\Model\ResourceModel\GridInterface $entityGrid,
37  ) {
38  $this->entityGrid = $entityGrid;
39  $this->globalConfig = $globalConfig;
40  }
41 
55  public function asyncInsert()
56  {
57  if ($this->globalConfig->getValue('dev/grid/async_indexing')) {
58  $this->entityGrid->refreshBySchedule();
59  }
60  }
61 }
__construct(\Magento\Sales\Model\ResourceModel\GridInterface $entityGrid, \Magento\Framework\App\Config\ScopeConfigInterface $globalConfig)