SourceItemRepository.php 997 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\Inventory\Model;
  8. use Magento\Framework\Api\SearchCriteriaInterface;
  9. use Magento\Inventory\Model\SourceItem\Command\GetListInterface;
  10. use Magento\InventoryApi\Api\Data\SourceItemSearchResultsInterface;
  11. use Magento\InventoryApi\Api\SourceItemRepositoryInterface;
  12. /**
  13. * @inheritdoc
  14. */
  15. class SourceItemRepository implements SourceItemRepositoryInterface
  16. {
  17. /**
  18. * @var GetListInterface
  19. */
  20. private $commandGetList;
  21. /**
  22. * @param GetListInterface $commandGetList
  23. */
  24. public function __construct(
  25. GetListInterface $commandGetList
  26. ) {
  27. $this->commandGetList = $commandGetList;
  28. }
  29. /**
  30. * @inheritdoc
  31. */
  32. public function getList(SearchCriteriaInterface $searchCriteria): SourceItemSearchResultsInterface
  33. {
  34. return $this->commandGetList->execute($searchCriteria);
  35. }
  36. }