123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- declare(strict_types=1);
- namespace Magento\InventoryIndexer\Indexer\Source;
- use Magento\InventoryIndexer\Indexer\Stock\StockIndexer;
- /**
- * Source indexer
- *
- * @api
- */
- class SourceIndexer
- {
- /**
- * @var GetAssignedStockIds
- */
- private $getAssignedStockIds;
- /**
- * @var StockIndexer
- */
- private $stockIndexer;
- /**
- * @param GetAssignedStockIds $getAssignedStockIds
- * @param StockIndexer $stockIndexer
- */
- public function __construct(
- GetAssignedStockIds $getAssignedStockIds,
- StockIndexer $stockIndexer
- ) {
- $this->getAssignedStockIds = $getAssignedStockIds;
- $this->stockIndexer = $stockIndexer;
- }
- /**
- * @return void
- */
- public function executeFull()
- {
- $this->stockIndexer->executeFull();
- }
- /**
- * @param string $sourceCode
- * @return void
- */
- public function executeRow(string $sourceCode)
- {
- $this->executeList([$sourceCode]);
- }
- /**
- * @param array $sourceCodes
- */
- public function executeList(array $sourceCodes)
- {
- $stockIds = $this->getAssignedStockIds->execute($sourceCodes);
- $this->stockIndexer->executeList($stockIds);
- }
- }
|