6 declare(strict_types=1);
11 use Magento\InventorySourceSelectionApi\Api\Data\SourceSelectionAlgorithmInterfaceFactory;
24 private $availableAlgorithms;
29 private $sourceSelectionAlgorithmFactory;
37 SourceSelectionAlgorithmInterfaceFactory $sourceSelectionAlgorithmFactory,
38 array $availableAlgorithms = []
40 $this->availableAlgorithms = $availableAlgorithms;
41 $this->sourceSelectionAlgorithmFactory = $sourceSelectionAlgorithmFactory;
50 foreach ($this->availableAlgorithms as
$data) {
51 $algorithmsList[] = $this->sourceSelectionAlgorithmFactory->create([
52 'code' =>
$data[
'code'],
53 'title' =>
$data[
'title'],
54 'description' =>
$data[
'description']
58 return $algorithmsList;
__construct(SourceSelectionAlgorithmInterfaceFactory $sourceSelectionAlgorithmFactory, array $availableAlgorithms=[])