CouponInterface.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\SalesRule\Api\Data;
  7. /**
  8. * Interface CouponInterface
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface CouponInterface extends \Magento\Framework\Api\ExtensibleDataInterface
  14. {
  15. const TYPE_MANUAL = 0;
  16. const TYPE_GENERATED = 1;
  17. /**
  18. * Get coupon id
  19. *
  20. * @return int|null
  21. */
  22. public function getCouponId();
  23. /**
  24. * Set coupon id
  25. *
  26. * @param int $couponId
  27. * @return $this
  28. */
  29. public function setCouponId($couponId);
  30. /**
  31. * Get the id of the rule associated with the coupon
  32. *
  33. * @return int
  34. */
  35. public function getRuleId();
  36. /**
  37. * Set rule id
  38. *
  39. * @param int $ruleId
  40. * @return $this
  41. */
  42. public function setRuleId($ruleId);
  43. /**
  44. * Get coupon code
  45. *
  46. * @return string|null
  47. */
  48. public function getCode();
  49. /**
  50. * Set coupon code
  51. *
  52. * @param string $code
  53. * @return $this
  54. */
  55. public function setCode($code);
  56. /**
  57. * Get usage limit
  58. *
  59. * @return int|null
  60. */
  61. public function getUsageLimit();
  62. /**
  63. * Set usage limit
  64. *
  65. * @param int $usageLimit
  66. * @return $this
  67. */
  68. public function setUsageLimit($usageLimit);
  69. /**
  70. * Get usage limit per customer
  71. *
  72. * @return int|null
  73. */
  74. public function getUsagePerCustomer();
  75. /**
  76. * Set usage limit per customer
  77. *
  78. * @param int $usagePerCustomer
  79. * @return $this
  80. */
  81. public function setUsagePerCustomer($usagePerCustomer);
  82. /**
  83. * Get the number of times the coupon has been used
  84. *
  85. * @return int
  86. */
  87. public function getTimesUsed();
  88. /**
  89. * @param int $timesUsed
  90. * @return $this
  91. */
  92. public function setTimesUsed($timesUsed);
  93. /**
  94. * Get expiration date
  95. *
  96. * @return string|null
  97. */
  98. public function getExpirationDate();
  99. /**
  100. * Set expiration date
  101. *
  102. * @param string $expirationDate
  103. * @return $this
  104. */
  105. public function setExpirationDate($expirationDate);
  106. /**
  107. * Whether the coupon is primary coupon for the rule that it's associated with
  108. *
  109. * @return bool
  110. * @SuppressWarnings(PHPMD.BooleanGetMethodName)
  111. */
  112. public function getIsPrimary();
  113. /**
  114. * Set whether the coupon is the primary coupon for the rule that it's associated with
  115. *
  116. * @param bool $isPrimary
  117. * @return $this
  118. */
  119. public function setIsPrimary($isPrimary);
  120. /**
  121. * Date when the coupon is created
  122. *
  123. * @return string|null
  124. */
  125. public function getCreatedAt();
  126. /**
  127. * Set the date the coupon is created
  128. *
  129. * @param string $createdAt
  130. * @return $this
  131. */
  132. public function setCreatedAt($createdAt);
  133. /**
  134. * Type of coupon
  135. *
  136. * @return int|null
  137. */
  138. public function getType();
  139. /**
  140. * @param int $type
  141. * @return $this
  142. */
  143. public function setType($type);
  144. /**
  145. * Retrieve existing extension attributes object or create a new one.
  146. *
  147. * @return \Magento\SalesRule\Api\Data\CouponExtensionInterface|null
  148. */
  149. public function getExtensionAttributes();
  150. /**
  151. * Set an extension attributes object.
  152. *
  153. * @param \Magento\SalesRule\Api\Data\CouponExtensionInterface $extensionAttributes
  154. * @return $this
  155. */
  156. public function setExtensionAttributes(
  157. \Magento\SalesRule\Api\Data\CouponExtensionInterface $extensionAttributes
  158. );
  159. }