6 declare(strict_types=1);
27 private $bulkInventoryTransferValidator;
32 private $bulkInventoryTransfer;
37 private $getProductIdsBySkus;
42 private $legacyIndexer;
47 private $defaultSourceProvider;
52 private $sourceIndexer;
66 BulkInventoryTransferResource $bulkInventoryTransfer,
72 $this->bulkInventoryTransferValidator = $inventoryTransferValidator;
73 $this->bulkInventoryTransfer = $bulkInventoryTransfer;
74 $this->getProductIdsBySkus = $getProductIdsBySkus;
75 $this->legacyIndexer = $legacyIndexer;
77 $this->sourceIndexer = $sourceIndexer;
84 private function reindexLegacy(array
$productIds): void
96 string $destinationSource,
97 bool $unassignFromOrigin
99 $validationResult = $this->bulkInventoryTransferValidator->validate(
105 if (!$validationResult->isValid()) {
109 $this->bulkInventoryTransfer->execute(
116 $this->sourceIndexer->executeList([$originSource, $destinationSource]);
118 if (($this->defaultSourceProvider->getCode() === $originSource) ||
119 ($this->defaultSourceProvider->getCode() === $destinationSource)) {
foreach($websiteCodes as $websiteCode) $skus
execute(array $skus, string $originSource, string $destinationSource, bool $unassignFromOrigin)
__construct(BulkInventoryTransferValidatorInterface $inventoryTransferValidator, BulkInventoryTransferResource $bulkInventoryTransfer, SourceIndexer $sourceIndexer, DefaultSourceProviderInterface $defaultSourceProvider, GetProductIdsBySkusInterface $getProductIdsBySkus, LegacyIndexer $legacyIndexer)