SaveInterface.php 1015 B

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