GetInterface.php 957 B

123456789101112131415161718192021222324252627282930313233
  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\Source\Command;
  8. use Magento\Framework\Exception\NoSuchEntityException;
  9. use Magento\InventoryApi\Api\Data\SourceInterface;
  10. /**
  11. * Get Source by code command (Service Provider Interface - SPI)
  12. *
  13. * Separate command interface to which Repository proxies initial Get call, could be considered as SPI - Interfaces
  14. * that you should extend and implement to customize current behaviour, but NOT expected to be used (called) in the code
  15. * of business logic directly
  16. *
  17. * @see \Magento\InventoryApi\Api\SourceRepositoryInterface
  18. * @api
  19. */
  20. interface GetInterface
  21. {
  22. /**
  23. * Get Source data by given code
  24. *
  25. * @param string $sourceCode
  26. * @return SourceInterface
  27. * @throws NoSuchEntityException
  28. */
  29. public function execute(string $sourceCode): SourceInterface;
  30. }