ReservationBuilderInterface.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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\InventoryReservationsApi\Model;
  8. use Magento\Framework\Validation\ValidationException;
  9. use Magento\InventoryReservationsApi\Model\ReservationInterface;
  10. /**
  11. * Used to build ReservationInterface objects
  12. *
  13. * @api
  14. * @see ReservationInterface
  15. */
  16. interface ReservationBuilderInterface
  17. {
  18. /**
  19. * @param int $stockId
  20. * @return self
  21. */
  22. public function setStockId(int $stockId): self;
  23. /**
  24. * @param string $sku
  25. * @return self
  26. */
  27. public function setSku(string $sku): self;
  28. /**
  29. * @param float $quantity
  30. * @return self
  31. */
  32. public function setQuantity(float $quantity): self;
  33. /**
  34. * @param string|null $metadata
  35. * @return self
  36. */
  37. public function setMetadata(string $metadata = null): self;
  38. /**
  39. * @return ReservationInterface
  40. * @throws ValidationException
  41. */
  42. public function build(): ReservationInterface;
  43. }