CouponGenerationSpecInterface.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. * CouponGenerationSpecInterface
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface CouponGenerationSpecInterface extends \Magento\Framework\Api\ExtensibleDataInterface
  14. {
  15. const COUPON_FORMAT_ALPHANUMERIC = 'alphanum';
  16. const COUPON_FORMAT_ALPHABETICAL = 'alpha';
  17. const COUPON_FORMAT_NUMERIC = 'num';
  18. /**
  19. * Get the id of the rule associated with the coupon
  20. *
  21. * @return int
  22. */
  23. public function getRuleId();
  24. /**
  25. * Set rule id
  26. *
  27. * @param int $ruleId
  28. * @return $this
  29. */
  30. public function setRuleId($ruleId);
  31. /**
  32. * Get format of generated coupon code
  33. *
  34. * @return string
  35. */
  36. public function getFormat();
  37. /**
  38. * Set format for generated coupon code
  39. *
  40. * @param string $format
  41. * @return $this
  42. */
  43. public function setFormat($format);
  44. /**
  45. * Number of coupons to generate
  46. *
  47. * @return int
  48. */
  49. public function getQuantity();
  50. /**
  51. * Set number of coupons to generate
  52. *
  53. * @param int $quantity
  54. * @return $this
  55. */
  56. public function setQuantity($quantity);
  57. /**
  58. * Get length of coupon code
  59. *
  60. * @return int
  61. */
  62. public function getLength();
  63. /**
  64. * Set length of coupon code
  65. *
  66. * @param int $length
  67. * @return $this
  68. */
  69. public function setLength($length);
  70. /**
  71. * Get the prefix
  72. *
  73. * @return string|null
  74. */
  75. public function getPrefix();
  76. /**
  77. * Set the prefix
  78. *
  79. * @param string $prefix
  80. * @return $this
  81. */
  82. public function setPrefix($prefix);
  83. /**
  84. * Get the suffix
  85. *
  86. * @return string|null
  87. */
  88. public function getSuffix();
  89. /**
  90. * Set the suffix
  91. *
  92. * @param string $suffix
  93. * @return $this
  94. */
  95. public function setSuffix($suffix);
  96. /**
  97. * Get the spacing where the delimiter should exist
  98. *
  99. * @return int|null
  100. */
  101. public function getDelimiterAtEvery();
  102. /**
  103. * Set the spacing where the delimiter should exist
  104. *
  105. * @param int $delimiterAtEvery
  106. * @return $this
  107. */
  108. public function setDelimiterAtEvery($delimiterAtEvery);
  109. /**
  110. * Get the delimiter
  111. *
  112. * @return string|null
  113. */
  114. public function getDelimiter();
  115. /**
  116. * Set the delimiter
  117. *
  118. * @param string $delimiter
  119. * @return $this
  120. */
  121. public function setDelimiter($delimiter);
  122. /**
  123. * Retrieve existing extension attributes object or create a new one.
  124. *
  125. * @return \Magento\SalesRule\Api\Data\CouponGenerationSpecExtensionInterface|null
  126. */
  127. public function getExtensionAttributes();
  128. /**
  129. * Set an extension attributes object.
  130. *
  131. * @param \Magento\SalesRule\Api\Data\CouponGenerationSpecExtensionInterface $extensionAttributes
  132. * @return $this
  133. */
  134. public function setExtensionAttributes(
  135. \Magento\SalesRule\Api\Data\CouponGenerationSpecExtensionInterface $extensionAttributes
  136. );
  137. }