6 declare(strict_types=1);
21 private $objectManager;
26 private $sourceSelectionMethods;
34 array $sourceSelectionMethods = []
37 $this->sourceSelectionMethods = $sourceSelectionMethods;
47 if (!isset($this->sourceSelectionMethods[$algorithmCode])) {
48 throw new \LogicException(
49 __(
'There is no such Source Selection Algorithm implemented: %1', $algorithmCode)
52 $sourceSelectionClassName = $this->sourceSelectionMethods[$algorithmCode];
54 $sourceSelectionAlgorithm = $this->objectManager->create($sourceSelectionClassName);
56 throw new \LogicException(
57 __(
'%1 doesn\'t implement SourceSelectionInterface', $sourceSelectionClassName)
60 return $sourceSelectionAlgorithm->execute($inventoryRequest);
__construct(ObjectManagerInterface $objectManager, array $sourceSelectionMethods=[])
execute(InventoryRequestInterface $inventoryRequest, string $algorithmCode)