CartItemInterface.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Quote\Api\Data;
  7. /**
  8. * Interface CartItemInterface
  9. * @api
  10. * @since 100.0.2
  11. */
  12. interface CartItemInterface extends \Magento\Framework\Api\ExtensibleDataInterface
  13. {
  14. /**#@+
  15. * Constants defined for keys of array, makes typos less likely
  16. */
  17. const KEY_ITEM_ID = 'item_id';
  18. const KEY_SKU = 'sku';
  19. const KEY_QTY = 'qty';
  20. const KEY_NAME = 'name';
  21. const KEY_PRICE = 'price';
  22. const KEY_PRODUCT_TYPE = 'product_type';
  23. const KEY_QUOTE_ID = 'quote_id';
  24. const KEY_PRODUCT_OPTION = 'product_option';
  25. /**#@-*/
  26. /**
  27. * Returns the item ID.
  28. *
  29. * @return int|null Item ID. Otherwise, null.
  30. */
  31. public function getItemId();
  32. /**
  33. * Sets the item ID.
  34. *
  35. * @param int $itemId
  36. * @return $this
  37. */
  38. public function setItemId($itemId);
  39. /**
  40. * Returns the product SKU.
  41. *
  42. * @return string|null Product SKU. Otherwise, null.
  43. */
  44. public function getSku();
  45. /**
  46. * Sets the product SKU.
  47. *
  48. * @param string $sku
  49. * @return $this
  50. */
  51. public function setSku($sku);
  52. /**
  53. * Returns the product quantity.
  54. *
  55. * @return float Product quantity.
  56. */
  57. public function getQty();
  58. /**
  59. * Sets the product quantity.
  60. *
  61. * @param float $qty
  62. * @return $this
  63. */
  64. public function setQty($qty);
  65. /**
  66. * Returns the product name.
  67. *
  68. * @return string|null Product name. Otherwise, null.
  69. */
  70. public function getName();
  71. /**
  72. * Sets the product name.
  73. *
  74. * @param string $name
  75. * @return $this
  76. */
  77. public function setName($name);
  78. /**
  79. * Returns the product price.
  80. *
  81. * @return float|null Product price. Otherwise, null.
  82. */
  83. public function getPrice();
  84. /**
  85. * Sets the product price.
  86. *
  87. * @param float $price
  88. * @return $this
  89. */
  90. public function setPrice($price);
  91. /**
  92. * Returns the product type.
  93. *
  94. * @return string|null Product type. Otherwise, null.
  95. */
  96. public function getProductType();
  97. /**
  98. * Sets the product type.
  99. *
  100. * @param string $productType
  101. * @return $this
  102. */
  103. public function setProductType($productType);
  104. /**
  105. * Returns Quote id.
  106. *
  107. * @return string
  108. */
  109. public function getQuoteId();
  110. /**
  111. * Sets Quote id.
  112. *
  113. * @param string $quoteId
  114. * @return $this
  115. */
  116. public function setQuoteId($quoteId);
  117. /**
  118. * Returns product option
  119. *
  120. * @return \Magento\Quote\Api\Data\ProductOptionInterface|null
  121. */
  122. public function getProductOption();
  123. /**
  124. * Sets product option
  125. *
  126. * @param \Magento\Quote\Api\Data\ProductOptionInterface $productOption
  127. * @return $this
  128. */
  129. public function setProductOption(\Magento\Quote\Api\Data\ProductOptionInterface $productOption);
  130. /**
  131. * Retrieve existing extension attributes object or create a new one.
  132. *
  133. * @return \Magento\Quote\Api\Data\CartItemExtensionInterface|null
  134. */
  135. public function getExtensionAttributes();
  136. /**
  137. * Set an extension attributes object.
  138. *
  139. * @param \Magento\Quote\Api\Data\CartItemExtensionInterface $extensionAttributes
  140. * @return $this
  141. */
  142. public function setExtensionAttributes(\Magento\Quote\Api\Data\CartItemExtensionInterface $extensionAttributes);
  143. }