SourceItemInterface.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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\InventoryApi\Api\Data;
  8. use Magento\Framework\Api\ExtensibleDataInterface;
  9. /**
  10. * Represents amount of product on physical storage
  11. * Entity id getter is missed because entity identifies by compound identifier (sku and source_code)
  12. *
  13. * Used fully qualified namespaces in annotations for proper work of WebApi request parser
  14. *
  15. * @api
  16. */
  17. interface SourceItemInterface extends ExtensibleDataInterface
  18. {
  19. /**#@+
  20. * Constants for keys of data array. Identical to the name of the getter in snake case
  21. */
  22. const SKU = 'sku';
  23. const SOURCE_CODE = 'source_code';
  24. const QUANTITY = 'quantity';
  25. const STATUS = 'status';
  26. /**#@-*/
  27. /**#@+
  28. * Source items status values
  29. */
  30. const STATUS_OUT_OF_STOCK = 0;
  31. const STATUS_IN_STOCK = 1;
  32. /**#@-*/
  33. /**
  34. * Get source item sku
  35. *
  36. * @return string|null
  37. */
  38. public function getSku(): ?string;
  39. /**
  40. * Set source item sku
  41. *
  42. * @param string|null $sku
  43. * @return void
  44. */
  45. public function setSku(?string $sku): void;
  46. /**
  47. * Get source code
  48. *
  49. * @return string|null
  50. */
  51. public function getSourceCode(): ?string;
  52. /**
  53. * Set source code
  54. *
  55. * @param string|null $sourceCode
  56. * @return void
  57. */
  58. public function setSourceCode(?string $sourceCode): void;
  59. /**
  60. * Get source item quantity
  61. *
  62. * @return float|null
  63. */
  64. public function getQuantity(): ?float;
  65. /**
  66. * Set source item quantity
  67. *
  68. * @param float|null $quantity
  69. * @return void
  70. */
  71. public function setQuantity(?float $quantity): void;
  72. /**
  73. * Get source item status (One of self::STATUS_*)
  74. *
  75. * @return int|null
  76. */
  77. public function getStatus(): ?int;
  78. /**
  79. * Set source item status (One of self::STATUS_*)
  80. *
  81. * @param int|null $status
  82. * @return void
  83. */
  84. public function setStatus(?int $status): void;
  85. /**
  86. * Retrieve existing extension attributes object
  87. *
  88. * @return \Magento\InventoryApi\Api\Data\SourceItemExtensionInterface|null
  89. */
  90. public function getExtensionAttributes(): ?\Magento\InventoryApi\Api\Data\SourceItemExtensionInterface;
  91. /**
  92. * Set an extension attributes object
  93. *
  94. * @param \Magento\InventoryApi\Api\Data\SourceItemExtensionInterface $extensionAttributes
  95. * @return void
  96. */
  97. public function setExtensionAttributes(
  98. \Magento\InventoryApi\Api\Data\SourceItemExtensionInterface $extensionAttributes
  99. ): void;
  100. }