Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SourceIndexer.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
11 
18 {
22  private $getAssignedStockIds;
23 
27  private $stockIndexer;
28 
33  public function __construct(
34  GetAssignedStockIds $getAssignedStockIds,
35  StockIndexer $stockIndexer
36  ) {
37  $this->getAssignedStockIds = $getAssignedStockIds;
38  $this->stockIndexer = $stockIndexer;
39  }
40 
44  public function executeFull()
45  {
46  $this->stockIndexer->executeFull();
47  }
48 
53  public function executeRow(string $sourceCode)
54  {
55  $this->executeList([$sourceCode]);
56  }
57 
61  public function executeList(array $sourceCodes)
62  {
63  $stockIds = $this->getAssignedStockIds->execute($sourceCodes);
64  $this->stockIndexer->executeList($stockIds);
65  }
66 }
$sourceCode
Definition: inventory.phtml:11
__construct(GetAssignedStockIds $getAssignedStockIds, StockIndexer $stockIndexer)