6 declare(strict_types=1);
21 private $getSourceItemsBySku;
26 private $getStockSourceLinksBySourceCode;
37 $this->getStockSourceLinksBySourceCode = $getStockSourceLinksBySourceCode;
44 public function execute(
string $sku): array
46 $sourceItems = $this->getSourceItemsBySku->execute($sku);
50 $stockSourceLinks = $this->getStockSourceLinksBySourceCode->execute(
$sourceItem->getSourceCode());
51 foreach ($stockSourceLinks as $stockSourceLink) {
52 $stocksIds[] = (int)$stockSourceLink->getStockId();
56 return array_unique($stocksIds);
__construct(GetSourceItemsBySkuInterface $getSourceItemsBySku, GetStockSourceLinksBySourceCode $getStockSourceLinksBySourceCode)