DeleteByIdInterface.php 1012 B

12345678910111213141516171819202122232425262728293031323334
  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\Stock\Command;
  8. use Magento\Framework\Exception\CouldNotDeleteException;
  9. use Magento\Framework\Exception\NoSuchEntityException;
  10. /**
  11. * Delete Stock by stockId command (Service Provider Interface - SPI)
  12. *
  13. * Separate command interface to which Repository proxies initial Delete 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\StockRepositoryInterface
  18. * @api
  19. */
  20. interface DeleteByIdInterface
  21. {
  22. /**
  23. * Delete the Stock data by stockId. If stock is not found do nothing
  24. *
  25. * @param int $stockId
  26. * @return void
  27. * @throws CouldNotDeleteException
  28. * @throws NoSuchEntityException
  29. */
  30. public function execute(int $stockId);
  31. }