1 | <?php |
||
10 | trait CouponTrait |
||
11 | { |
||
12 | /** |
||
13 | * The coupon code. |
||
14 | * |
||
15 | * @var string |
||
16 | * |
||
17 | * @JMS\Type("string") |
||
18 | * @JMS\SerializedName("CODE") |
||
19 | */ |
||
20 | protected $code; |
||
21 | |||
22 | /** |
||
23 | * The coupon title. |
||
24 | * |
||
25 | * @var string |
||
26 | * |
||
27 | * @JMS\Type("string") |
||
28 | * @JMS\SerializedName("TITLE") |
||
29 | */ |
||
30 | protected $title; |
||
31 | |||
32 | /** |
||
33 | * The coupon discount. |
||
34 | * |
||
35 | * @var string |
||
36 | * |
||
37 | * @JMS\Type("string") |
||
38 | * @JMS\SerializedName("DISCOUNT") |
||
39 | */ |
||
40 | protected $discount; |
||
41 | |||
42 | /** |
||
43 | * The coupon discount amount. |
||
44 | * |
||
45 | * @var float |
||
46 | * |
||
47 | * @JMS\Type("float") |
||
48 | * @JMS\SerializedName("DISCOUNT_AMOUNT") |
||
49 | */ |
||
50 | protected $discountAmount; |
||
51 | |||
52 | /** |
||
53 | * The coupon discount type. |
||
54 | * |
||
55 | * @var string |
||
56 | * |
||
57 | * @JMS\Type("string") |
||
58 | * @JMS\SerializedName("DISCOUNT_TYPE") |
||
59 | */ |
||
60 | protected $discountType; |
||
61 | |||
62 | /** |
||
63 | * The coupon discount period. |
||
64 | * |
||
65 | * @var string |
||
66 | * |
||
67 | * @JMS\Type("string") |
||
68 | * @JMS\SerializedName("DISCOUNT_PERIOD") |
||
69 | */ |
||
70 | protected $discountPeriod; |
||
71 | |||
72 | /** |
||
73 | * The coupon discount period amount. |
||
74 | * |
||
75 | * @var integer |
||
76 | * |
||
77 | * @JMS\Type("integer") |
||
78 | * @JMS\SerializedName("DISCOUNT_PERIOD_AMOUNT") |
||
79 | */ |
||
80 | protected $discountPeriodAmount; |
||
81 | |||
82 | /** |
||
83 | * The coupon discount period unit. |
||
84 | * |
||
85 | * @var string |
||
86 | * |
||
87 | * @JMS\Type("string") |
||
88 | * @JMS\SerializedName("DISCOUNT_PERIOD_UNIT") |
||
89 | */ |
||
90 | protected $discountPeriodUnit; |
||
91 | |||
92 | /** |
||
93 | * The coupon campaign. |
||
94 | * |
||
95 | * @var string |
||
96 | * |
||
97 | * @JMS\Type("string") |
||
98 | * @JMS\SerializedName("CAMPAIGN") |
||
99 | */ |
||
100 | protected $campaign = ''; |
||
101 | |||
102 | /** |
||
103 | * The coupon valid from. |
||
104 | * |
||
105 | * @var \DateTime |
||
106 | * |
||
107 | * @JMS\Type("DateTime<'Y-m-d'>") |
||
108 | * @JMS\SerializedName("VALID_FROM") |
||
109 | */ |
||
110 | protected $validFrom; |
||
111 | |||
112 | /** |
||
113 | * The coupon valid to. |
||
114 | * |
||
115 | * @var \DateTime |
||
116 | * |
||
117 | * @JMS\Type("DateTime<'Y-m-d'>") |
||
118 | * @JMS\SerializedName("VALID_TO") |
||
119 | */ |
||
120 | protected $validTo; |
||
121 | |||
122 | /** |
||
123 | * The coupon assigned articles. |
||
124 | * |
||
125 | * @var string |
||
126 | * |
||
127 | * @JMS\Type("string") |
||
128 | * @JMS\SerializedName("ASSIGNED_ARTICLES") |
||
129 | */ |
||
130 | protected $assignedArticles = ''; |
||
131 | |||
132 | /** |
||
133 | * The coupon affiliate. |
||
134 | * |
||
135 | * @var string |
||
136 | * |
||
137 | * @JMS\Type("string") |
||
138 | * @JMS\SerializedName("AFFILIATE") |
||
139 | */ |
||
140 | protected $affiliate; |
||
141 | |||
142 | /** |
||
143 | * The coupon number of usages. |
||
144 | * |
||
145 | * @var integer |
||
146 | * |
||
147 | * @JMS\Type("integer") |
||
148 | * @JMS\SerializedName("USAGES") |
||
149 | */ |
||
150 | protected $usages; |
||
151 | |||
152 | /** |
||
153 | * The coupon maximum number of usages. |
||
154 | * |
||
155 | * @var integer |
||
156 | * |
||
157 | * @JMS\Type("integer") |
||
158 | * @JMS\SerializedName("USAGES_MAX") |
||
159 | */ |
||
160 | protected $usagesMax; |
||
161 | |||
162 | /** |
||
163 | * The coupon state. |
||
164 | * |
||
165 | * @var string |
||
166 | * |
||
167 | * @JMS\Type("string") |
||
168 | * @JMS\SerializedName("STATE") |
||
169 | */ |
||
170 | protected $state; |
||
171 | |||
172 | /** |
||
173 | * Get the code. |
||
174 | * |
||
175 | * @return string |
||
176 | */ |
||
177 | public function getCode() |
||
181 | |||
182 | /** |
||
183 | * Set the code. |
||
184 | * |
||
185 | * @param string $code The code to set. |
||
186 | * @return $this |
||
187 | */ |
||
188 | 6 | public function setCode($code) |
|
194 | |||
195 | /** |
||
196 | * Get the title. |
||
197 | * |
||
198 | * @return string |
||
199 | */ |
||
200 | public function getTitle() |
||
204 | |||
205 | /** |
||
206 | * Set the title. |
||
207 | * |
||
208 | * @param string $title The title. |
||
209 | * @return $this |
||
210 | */ |
||
211 | 6 | public function setTitle($title) |
|
217 | |||
218 | /** |
||
219 | * Get the discount. |
||
220 | * |
||
221 | * @return string |
||
222 | */ |
||
223 | public function getDiscount() |
||
227 | |||
228 | /** |
||
229 | * Set the discount. |
||
230 | * |
||
231 | * @param string $discount |
||
232 | * @return $this |
||
233 | */ |
||
234 | 3 | public function setDiscount($discount) |
|
240 | |||
241 | /** |
||
242 | * Get the discount amount. |
||
243 | * |
||
244 | * @return string |
||
245 | */ |
||
246 | public function getDiscountAmount() |
||
250 | |||
251 | /** |
||
252 | * Set the discount amount. |
||
253 | * |
||
254 | * @param float $discountAmount |
||
255 | * @return $this |
||
256 | */ |
||
257 | 3 | public function setDiscountAmount($discountAmount) |
|
263 | |||
264 | /** |
||
265 | * Get the discount type. |
||
266 | * |
||
267 | * @return string |
||
268 | */ |
||
269 | public function getDiscountType() |
||
273 | |||
274 | /** |
||
275 | * Set the discount type. |
||
276 | * |
||
277 | * @param string $discountType |
||
278 | * @return $this |
||
279 | */ |
||
280 | 3 | public function setDiscountType($discountType) |
|
286 | |||
287 | /** |
||
288 | * Get the discount period. |
||
289 | * |
||
290 | * @return string |
||
291 | */ |
||
292 | public function getDiscountPeriod() |
||
296 | |||
297 | /** |
||
298 | * Set the discount period. |
||
299 | * |
||
300 | * @param string $discountPeriod The period to set. |
||
301 | * @return $this |
||
302 | */ |
||
303 | 3 | public function setDiscountPeriod($discountPeriod) |
|
309 | |||
310 | /** |
||
311 | * Get the discount period amount. |
||
312 | * |
||
313 | * @return integer |
||
314 | */ |
||
315 | public function getDiscountPeriodAmount() |
||
319 | |||
320 | /** |
||
321 | * Set the discount period amount. |
||
322 | * |
||
323 | * @param integer $discountPeriodAmount |
||
324 | * @return $this |
||
325 | */ |
||
326 | 6 | public function setDiscountPeriodAmount($discountPeriodAmount) |
|
332 | |||
333 | /** |
||
334 | * Get the discount period unit. |
||
335 | * |
||
336 | * @return string |
||
337 | */ |
||
338 | public function getDiscountPeriodUnit() |
||
342 | |||
343 | /** |
||
344 | * Set the discount period unit. |
||
345 | * |
||
346 | * @param string $discountPeriodUnit |
||
347 | * @return $this |
||
348 | */ |
||
349 | 6 | public function setDiscountPeriodUnit($discountPeriodUnit) |
|
355 | |||
356 | /** |
||
357 | * Get the campaign. |
||
358 | * |
||
359 | * @return string |
||
360 | */ |
||
361 | public function getCampaign() |
||
365 | |||
366 | /** |
||
367 | * Set the campaign. |
||
368 | * |
||
369 | * @param string $campaign The campaign. |
||
370 | * @return $this |
||
371 | */ |
||
372 | 3 | public function setCampaign($campaign) |
|
378 | |||
379 | /** |
||
380 | * Check if the coupon is part of a campaign. |
||
381 | * |
||
382 | * @return boolean |
||
383 | */ |
||
384 | public function hasCampaign() |
||
388 | |||
389 | /** |
||
390 | * Get the date from which the coupon is valid. |
||
391 | * |
||
392 | * @return \DateTime |
||
393 | */ |
||
394 | 3 | public function getValidFrom() |
|
398 | |||
399 | /** |
||
400 | * Set the date from which the coupon is valid. |
||
401 | * |
||
402 | * @param \DateTime $validFrom The date. |
||
403 | * @return $this |
||
404 | */ |
||
405 | 3 | public function setValidFrom(\DateTime $validFrom) |
|
411 | |||
412 | /** |
||
413 | * Get the date until the coupon is valid. |
||
414 | * |
||
415 | * @return \DateTime |
||
416 | */ |
||
417 | 3 | public function getValidTo() |
|
421 | |||
422 | /** |
||
423 | * Set the date until the coupon is valid. |
||
424 | * |
||
425 | * @param mixed $validTo The date. |
||
426 | * @return $this |
||
427 | */ |
||
428 | 3 | public function setValidTo($validTo) |
|
434 | |||
435 | /** |
||
436 | * Get the assigned articles. |
||
437 | * |
||
438 | * @return array |
||
439 | */ |
||
440 | public function getAssignedArticles() |
||
446 | |||
447 | /** |
||
448 | * Set the assigned articles. |
||
449 | * |
||
450 | * @param array $assignedArticles The assigned articles. |
||
451 | * @return $this |
||
452 | */ |
||
453 | 3 | public function setAssignedArticles(array $assignedArticles) |
|
459 | |||
460 | /** |
||
461 | * Get the affiliate. |
||
462 | * |
||
463 | * @return string |
||
464 | */ |
||
465 | public function getAffiliate() |
||
469 | |||
470 | /** |
||
471 | * Set the affiliate. |
||
472 | * |
||
473 | * @param string $affiliate The affiliate. |
||
474 | * @return $this |
||
475 | */ |
||
476 | public function setAffiliate($affiliate) |
||
482 | |||
483 | /** |
||
484 | * Get the number of usages. |
||
485 | * |
||
486 | * @return integer |
||
487 | */ |
||
488 | public function getUsages() |
||
492 | |||
493 | /** |
||
494 | * Set the number of usages. |
||
495 | * |
||
496 | * @param integer $usages The usages. |
||
497 | * @return $this |
||
498 | */ |
||
499 | 3 | public function setUsages($usages) |
|
505 | |||
506 | /** |
||
507 | * Get the maximum usages. |
||
508 | * |
||
509 | * @return integer |
||
510 | */ |
||
511 | public function getUsagesMax() |
||
515 | |||
516 | /** |
||
517 | * Set the maximum usages. |
||
518 | * |
||
519 | * @param integer $usagesMax The maximum usages. |
||
520 | * @return $this |
||
521 | */ |
||
522 | 6 | public function setUsagesMax($usagesMax) |
|
528 | |||
529 | /** |
||
530 | * Get the state. |
||
531 | * |
||
532 | * @return string |
||
533 | */ |
||
534 | public function getState() |
||
538 | |||
539 | /** |
||
540 | * Set the state. |
||
541 | * |
||
542 | * @param string $state The state. |
||
543 | * @return $this |
||
544 | */ |
||
545 | 3 | public function setState($state) |
|
551 | } |
||
552 |