PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/magento/module-sales-rule/Api/Data/RuleInterface.php

https://gitlab.com/yousafsyed/easternglamor
PHP | 449 lines | 71 code | 59 blank | 319 comment | 0 complexity | d682d5f604ac498166e39efebb481c04 MD5 | raw file
  1. <?php
  2. /**
  3. * Copyright © 2016 Magento. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\SalesRule\Api\Data;
  7. /**
  8. * Interface RuleInterface
  9. *
  10. * @api
  11. */
  12. interface RuleInterface extends \Magento\Framework\Api\ExtensibleDataInterface
  13. {
  14. const FREE_SHIPPING_NONE = 'NONE';
  15. const FREE_SHIPPING_MATCHING_ITEMS_ONLY = 'MATCHING_ITEMS_ONLY';
  16. const FREE_SHIPPING_WITH_MATCHING_ITEMS = 'FREE_WITH_MATCHING_ITEMS';
  17. const DISCOUNT_ACTION_BY_PERCENT = 'by_percent';
  18. const DISCOUNT_ACTION_FIXED_AMOUNT = 'by_fixed';
  19. const DISCOUNT_ACTION_FIXED_AMOUNT_FOR_CART = 'cart_fixed';
  20. const DISCOUNT_ACTION_BUY_X_GET_Y = 'buy_x_get_y';
  21. const COUPON_TYPE_NO_COUPON = 'NO_COUPON';
  22. const COUPON_TYPE_SPECIFIC_COUPON = 'SPECIFIC_COUPON';
  23. const COUPON_TYPE_AUTO = 'AUTO';
  24. /**
  25. * Return rule id
  26. *
  27. * @return int|null
  28. */
  29. public function getRuleId();
  30. /**
  31. * Set rule id
  32. *
  33. * @param int $ruleId
  34. * @return $this
  35. */
  36. public function setRuleId($ruleId);
  37. /**
  38. * Get rule name
  39. *
  40. * @return string|null
  41. */
  42. public function getName();
  43. /**
  44. * Set rule name
  45. *
  46. * @param string $name
  47. * @return $this
  48. */
  49. public function setName($name);
  50. /**
  51. * Get display label
  52. *
  53. * @return \Magento\SalesRule\Api\Data\RuleLabelInterface[]|null
  54. */
  55. public function getStoreLabels();
  56. /**
  57. * Set display label
  58. *
  59. * @param \Magento\SalesRule\Api\Data\RuleLabelInterface[]|null $storeLabels
  60. * @return $this
  61. */
  62. public function setStoreLabels(array $storeLabels = null);
  63. /**
  64. * Get description
  65. *
  66. * @return string|null
  67. */
  68. public function getDescription();
  69. /**
  70. * Set description
  71. *
  72. * @param string $description
  73. * @return $this
  74. */
  75. public function setDescription($description);
  76. /**
  77. * Get a list of websites the rule applies to
  78. *
  79. * @return int[]
  80. */
  81. public function getWebsiteIds();
  82. /**
  83. * Set the websites the rule applies to
  84. *
  85. * @param int[] $websiteIds
  86. * @return $this
  87. */
  88. public function setWebsiteIds(array $websiteIds);
  89. /**
  90. * Get ids of customer groups that the rule applies to
  91. *
  92. * @return int[]
  93. */
  94. public function getCustomerGroupIds();
  95. /**
  96. * Set the customer groups that the rule applies to
  97. *
  98. * @param int[] $customerGroupIds
  99. * @return $this
  100. */
  101. public function setCustomerGroupIds(array $customerGroupIds);
  102. /**
  103. * Get the start date when the coupon is active
  104. *
  105. * @return string|null
  106. */
  107. public function getFromDate();
  108. /**
  109. * Set the star date when the coupon is active
  110. *
  111. * @param string $fromDate
  112. * @return $this
  113. */
  114. public function setFromDate($fromDate);
  115. /**
  116. * Get the end date when the coupon is active
  117. *
  118. * @return string|null
  119. */
  120. public function getToDate();
  121. /**
  122. * Set the end date when the coupon is active
  123. *
  124. * @param string $fromDate
  125. * @return $this
  126. */
  127. public function setToDate($fromDate);
  128. /**
  129. * Get number of uses per customer
  130. *
  131. * @return int
  132. */
  133. public function getUsesPerCustomer();
  134. /**
  135. * Get number of uses per customer
  136. *
  137. * @param int $usesPerCustomer
  138. * @return $this
  139. */
  140. public function setUsesPerCustomer($usesPerCustomer);
  141. /**
  142. * Whether the coupon is active
  143. *
  144. * @return bool
  145. * @SuppressWarnings(PHPMD.BooleanGetMethodName)
  146. */
  147. public function getIsActive();
  148. /**
  149. * Set whether the coupon is active
  150. *
  151. * @param bool $isActive
  152. * @return bool
  153. */
  154. public function setIsActive($isActive);
  155. /**
  156. * Get condition for the rule
  157. *
  158. * @return \Magento\SalesRule\Api\Data\ConditionInterface|null
  159. */
  160. public function getCondition();
  161. /**
  162. * Set condition for the rule
  163. *
  164. * @param \Magento\SalesRule\Api\Data\ConditionInterface|null $condition
  165. * @return $this
  166. */
  167. public function setCondition(ConditionInterface $condition = null);
  168. /**
  169. * Get action condition
  170. *
  171. * @return \Magento\SalesRule\Api\Data\ConditionInterface|null
  172. */
  173. public function getActionCondition();
  174. /**
  175. * Set action condition
  176. *
  177. * @param \Magento\SalesRule\Api\Data\ConditionInterface|null $actionCondition
  178. * @return $this
  179. */
  180. public function setActionCondition(ConditionInterface $actionCondition = null);
  181. /**
  182. * Whether to stop rule processing
  183. *
  184. * @return bool
  185. * @SuppressWarnings(PHPMD.BooleanGetMethodName)
  186. */
  187. public function getStopRulesProcessing();
  188. /**
  189. * Set whether to stop rule processing
  190. *
  191. * @param bool $stopRulesProcessing
  192. * @return $this
  193. */
  194. public function setStopRulesProcessing($stopRulesProcessing);
  195. /**
  196. * TODO: is this field needed
  197. *
  198. * @return bool
  199. * @SuppressWarnings(PHPMD.BooleanGetMethodName)
  200. */
  201. public function getIsAdvanced();
  202. /**
  203. * @param bool $isAdvanced
  204. * @return $this
  205. */
  206. public function setIsAdvanced($isAdvanced);
  207. /**
  208. * Return product ids
  209. *
  210. * @return int[]|null
  211. */
  212. public function getProductIds();
  213. /**
  214. * Set product ids
  215. *
  216. * @param int[]|null $productIds
  217. * @return $this
  218. */
  219. public function setProductIds(array $productIds = null);
  220. /**
  221. * Get sort order
  222. *
  223. * @return int
  224. */
  225. public function getSortOrder();
  226. /**
  227. * @param int $sortOrder
  228. * @return $this
  229. */
  230. public function setSortOrder($sortOrder);
  231. /**
  232. * Get simple action of the rule
  233. *
  234. * @return string|null
  235. */
  236. public function getSimpleAction();
  237. /**
  238. * Set simple action
  239. *
  240. * @param string $simpleAction
  241. * @return $this
  242. */
  243. public function setSimpleAction($simpleAction);
  244. /**
  245. * Get discount amount
  246. *
  247. * @return float
  248. */
  249. public function getDiscountAmount();
  250. /**
  251. * Set discount amount
  252. *
  253. * @param float $discountAmount
  254. * @return $this
  255. */
  256. public function setDiscountAmount($discountAmount);
  257. /**
  258. * Return maximum qty discount is applied
  259. *
  260. * @return float|null
  261. */
  262. public function getDiscountQty();
  263. /**
  264. * Set maximum qty discount is applied
  265. *
  266. * @param float $discountQty
  267. * @return $this
  268. */
  269. public function setDiscountQty($discountQty);
  270. /**
  271. * Get discount step
  272. *
  273. * @return int
  274. */
  275. public function getDiscountStep();
  276. /**
  277. * Set discount step
  278. *
  279. * @param int $discountStep
  280. * @return $this
  281. */
  282. public function setDiscountStep($discountStep);
  283. /**
  284. * Whether the rule applies to shipping
  285. *
  286. * @return bool
  287. * @SuppressWarnings(PHPMD.BooleanGetMethodName)
  288. */
  289. public function getApplyToShipping();
  290. /**
  291. * Set whether the rule applies to shipping
  292. *
  293. * @param bool $applyToShipping
  294. * @return $this
  295. */
  296. public function setApplyToShipping($applyToShipping);
  297. /**
  298. * Return how many times the rule has been used
  299. *
  300. * @return int
  301. */
  302. public function getTimesUsed();
  303. /**
  304. * Set how many times the rule has been used
  305. *
  306. * @param int $timesUsed
  307. * @return $this
  308. */
  309. public function setTimesUsed($timesUsed);
  310. /**
  311. * Return whether the rule is in RSS
  312. *
  313. * @return bool
  314. * @SuppressWarnings(PHPMD.BooleanGetMethodName)
  315. */
  316. public function getIsRss();
  317. /**
  318. * Set whether the rule is shown in RSS
  319. *
  320. * @param bool $isRss
  321. * @return $this
  322. */
  323. public function setIsRss($isRss);
  324. /**
  325. * Get coupon type
  326. *
  327. * @return string
  328. */
  329. public function getCouponType();
  330. /**
  331. * Set coupon type
  332. *
  333. * @param string $couponType
  334. * @return $this
  335. */
  336. public function setCouponType($couponType);
  337. /**
  338. * Whether to auto generate coupon
  339. *
  340. * @return bool
  341. * @SuppressWarnings(PHPMD.BooleanGetMethodName)
  342. */
  343. public function getUseAutoGeneration();
  344. /**
  345. * Set whether the rule uses auto coupon generation
  346. *
  347. * @param bool $useAutoGeneration
  348. * @return $this
  349. */
  350. public function setUseAutoGeneration($useAutoGeneration);
  351. /**
  352. * Return limit of uses per coupon
  353. *
  354. * @return int
  355. */
  356. public function getUsesPerCoupon();
  357. /**
  358. * Set the limit of uses per coupon
  359. *
  360. * @param int $usesPerCoupon
  361. * @return $this
  362. */
  363. public function setUsesPerCoupon($usesPerCoupon);
  364. /**
  365. * When to grant free shipping
  366. *
  367. * @return string|null
  368. */
  369. public function getSimpleFreeShipping();
  370. /**
  371. * Set when to grant free shipping
  372. *
  373. * @param string $simpleFreeShipping
  374. * @return $this
  375. */
  376. public function setSimpleFreeShipping($simpleFreeShipping);
  377. /**
  378. * Retrieve existing extension attributes object or create a new one.
  379. *
  380. * @return \Magento\SalesRule\Api\Data\RuleExtensionInterface|null
  381. */
  382. public function getExtensionAttributes();
  383. /**
  384. * Set an extension attributes object.
  385. *
  386. * @param \Magento\SalesRule\Api\Data\RuleExtensionInterface $extensionAttributes
  387. * @return $this
  388. */
  389. public function setExtensionAttributes(\Magento\SalesRule\Api\Data\RuleExtensionInterface $extensionAttributes);
  390. }