ItemToSellInterface.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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\InventorySalesApi\Api\Data;
  8. /**
  9. * DTO used as the type for values of `$items` array passed to PlaceReservationsForSalesEventInterface::execute()
  10. * @see \Magento\InventorySalesApi\Api\PlaceReservationsForSalesEventInterface
  11. *
  12. * @api
  13. */
  14. interface ItemToSellInterface extends \Magento\Framework\Api\ExtensibleDataInterface
  15. {
  16. /**
  17. * @return string
  18. */
  19. public function getSku(): string;
  20. /**
  21. * @return float
  22. */
  23. public function getQuantity(): float;
  24. /**
  25. * @param string $sku
  26. * @return void
  27. */
  28. public function setSku(string $sku): void;
  29. /**
  30. * @param float $qty
  31. * @return void
  32. */
  33. public function setQuantity(float $qty): void;
  34. /**
  35. * Retrieve existing extension attributes object
  36. *
  37. * @return \Magento\InventorySalesApi\Api\Data\ItemToSellExtensionInterface|null
  38. */
  39. public function getExtensionAttributes(): ?\Magento\InventorySalesApi\Api\Data\ItemToSellExtensionInterface;
  40. /**
  41. * Set an extension attributes object
  42. *
  43. * @param \Magento\InventorySalesApi\Api\Data\ItemToSellExtensionInterface $extensionAttributes
  44. * @return void
  45. */
  46. public function setExtensionAttributes(
  47. \Magento\InventorySalesApi\Api\Data\ItemToSellExtensionInterface $extensionAttributes
  48. ): void;
  49. }