Completed
Push — master ( 8de32c...fc5d5e )
by Dragos
14:10
created

SubscriptionTrait::setCoupon()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 0
cts 1
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Speicher210\Fastbill\Api\Model;
4
5
use JMS\Serializer\Annotation as JMS;
6
7
/**
8
 * Trait for subscription data.
9
 */
10
trait SubscriptionTrait
11
{
12
13
    /**
14
     * The subscription ID.
15
     *
16
     * @var integer
17
     *
18
     * @JMS\Type("integer")
19
     * @JMS\SerializedName("SUBSCRIPTION_ID")
20
     */
21
    protected $subscriptionId;
22
23
    /**
24
     * The customer ID.
25
     *
26
     * @var integer
27
     *
28
     * @JMS\Type("integer")
29
     * @JMS\SerializedName("CUSTOMER_ID")
30
     */
31
    protected $customerId;
32
33
    /**
34
     * The subscription title.
35
     *
36
     * @var string
37
     *
38
     * @JMS\Type("string")
39
     * @JMS\SerializedName("SUBSCRIPTION_TITLE")
40
     */
41
    protected $subscriptionTitle;
42
43
    /**
44
     * The subscription start.
45
     *
46
     * @var \DateTime
47
     *
48
     * @JMS\Type("DateTime<'Y-m-d H:i:s'>")
49
     * @JMS\SerializedName("START")
50
     */
51
    protected $subscriptionStart;
52
53
    /**
54
     * The subscription next event.
55
     *
56
     * @var \DateTime
57
     *
58
     * @JMS\Type("DateTime<'Y-m-d H:i:s'>")
59
     * @JMS\SerializedName("NEXT_EVENT")
60
     */
61
    protected $nextEvent;
62
63
    /**
64
     * The subscription cancellation date.
65
     *
66
     * @var \DateTime
67
     *
68
     * @JMS\Type("DateTime<'Y-m-d H:i:s'>")
69
     * @JMS\SerializedName("CANCELLATION_DATE")
70
     */
71
    protected $cancellationDate;
72
73
    /**
74
     * The subscription status.
75
     *
76
     * @var string
77
     *
78
     * @JMS\Type("string")
79
     * @JMS\SerializedName("STATUS")
80
     */
81
    protected $status;
82
83
    /**
84
     * The subscription hash.
85
     *
86
     * @var string
87
     *
88
     * @JMS\Type("string")
89
     * @JMS\SerializedName("HASH")
90
     */
91
    protected $hash;
92
93
    /**
94
     * The subscription X-Attribute.
95
     *
96
     * @var array
97
     *
98
     * @JMS\Type("array")
99
     * @JMS\SerializedName("X_ATTRIBUTES")
100
     */
101
    protected $xAttributes = array();
102
103
    /**
104
     * The subscription article number.
105
     *
106
     * @var string
107
     *
108
     * @JMS\Type("string")
109
     * @JMS\SerializedName("ARTICLE_NUMBER")
110
     */
111
    protected $articleNumber;
112
113
    /**
114
     * The subscription quantity.
115
     *
116
     * @var integer
117
     *
118
     * @JMS\Type("integer")
119
     * @JMS\SerializedName("QUANTITY")
120
     */
121
    protected $quantity;
122
123
    /**
124
     * @var SubscriptionPlanObject
125
     *
126
     * @JMS\Type("Speicher210\Fastbill\Api\Model\SubscriptionPlanObject")
127
     * @JMS\SerializedName("PLAN")
128
     */
129
    protected $plan;
130
131
    /**
132
     * The external subscription ID.
133
     *
134
     * @var string
135
     *
136
     * @JMS\Type("string")
137
     * @JMS\SerializedName("SUBSCRIPTION_EXT_UID")
138
     */
139
    protected $subscriptionExternalId;
140
141
    /**
142
     * The invoice title.
143
     *
144
     * @var string
145
     *
146
     * @JMS\Type("string")
147
     * @JMS\SerializedName("INVOICE_TITLE")
148
     */
149
    protected $invoiceTitle;
150
151
    /**
152
     * The coupon applied to the subscription.
153
     *
154
     * @var Coupon
155
     *
156
     * @JMS\Type("Speicher210\Fastbill\Api\Model\Coupon")
157
     * @JMS\SerializedName("COUPON")
158
     */
159
    protected $coupon;
160
161
    /**
162
     * The last event date and time.
163
     *
164
     * @var \DateTime
165
     *
166
     * @JMS\Type("DateTime<'Y-m-d H:i:s'>")
167
     * @JMS\SerializedName("LAST_EVENT")
168
     */
169
    protected $lastEvent;
170
171
    /**
172
     * The reason for cancellation of a subscription.
173
     *
174
     * @var string
175
     *
176
     * @JMS\Type("string")
177
     * @JMS\SerializedName("CANCELLATION_NOTE")
178
     */
179
    protected $cancellationNote;
180
181
    /**
182
     * @var array
183
     *
184
     * @JMS\Type("array")
185
     * @JMS\SerializedName("ADDONS")
186
     */
187
    protected $addons;
188
189
    /**
190
     * Date and time when the subscription expires.
191
     *
192
     * @var \DateTime
193
     *
194
     * @JMS\Type("DateTime<'Y-m-d H:i:s'>")
195
     * @JMS\SerializedName("EXPIRATION_DATE")
196
     */
197
    protected $expirationDate;
198
199
    /**
200
     * @var SubscriptionPlanObject
201
     *
202 3
     * @JMS\Type("Speicher210\Fastbill\Api\Model\SubscriptionPlanObject")
203
     * @JMS\SerializedName("PLAN_UPCOMING")
204 3
     */
205
    protected $planUpcoming;
206
207
    /**
208
     * Get the subscription ID.
209
     *
210
     * @return integer
211
     */
212
    public function getSubscriptionId()
213 9
    {
214
        return $this->subscriptionId;
215 9
    }
216
217 9
    /**
218
     * Set the subscription ID.
219
     *
220
     * @param integer $subscriptionId The subscription ID.
221
     * @return $this
222
     */
223
    public function setSubscriptionId($subscriptionId)
224
    {
225
        $this->subscriptionId = $subscriptionId;
226
227
        return $this;
228
    }
229
230
    /**
231
     * Get the customer ID.
232
     *
233
     * @return integer
234
     */
235
    public function getCustomerId()
236 15
    {
237
        return $this->customerId;
238 15
    }
239
240 15
    /**
241
     * Set the customer ID.
242
     *
243
     * @param integer $customerId The ID of the customer.
244
     * @return $this
245
     */
246
    public function setCustomerId($customerId)
247
    {
248
        $this->customerId = $customerId;
249
250
        return $this;
251
    }
252
253
    /**
254
     * Get the external subscription ID.
255
     *
256
     * @return string
257
     */
258
    public function getSubscriptionExternalId()
259
    {
260
        return $this->subscriptionExternalId;
261
    }
262
263
    /**
264
     * Set the external subscription ID.
265
     *
266
     * @param string $subscriptionExternalId The external subscription ID.
267
     * @return $this
268
     */
269
    public function setSubscriptionExternalId($subscriptionExternalId)
270
    {
271
        $this->subscriptionExternalId = $subscriptionExternalId;
272
273
        return $this;
274
    }
275
276
    /**
277
     * Get the subscription title.
278
     *
279
     * @return string
280
     */
281
    public function getSubscriptionTitle()
282 6
    {
283
        return $this->subscriptionTitle;
284 6
    }
285
286 6
    /**
287
     * Set the subscription title.
288
     *
289
     * @param string $subscriptionTitle The title.
290
     * @return $this
291
     */
292
    public function setSubscriptionTitle($subscriptionTitle)
293
    {
294
        $this->subscriptionTitle = $subscriptionTitle;
295
296
        return $this;
297
    }
298
299
    /**
300
     * Get the subscription start.
301
     *
302
     * @return \DateTime
303
     */
304
    public function getSubscriptionStart()
305 6
    {
306
        return $this->subscriptionStart;
307 6
    }
308
309 6
    /**
310
     * Set the subscription start.
311
     *
312
     * @param \DateTime $subscriptionStart
313
     * @return $this
314
     */
315
    public function setSubscriptionStart($subscriptionStart)
316
    {
317
        $this->subscriptionStart = $subscriptionStart;
318
319
        return $this;
320
    }
321
322
    /**
323
     * @return \DateTime
324 6
     */
325
    public function getNextEvent()
326 6
    {
327
        return $this->nextEvent;
328 6
    }
329
330
    /**
331
     * @param \DateTime $nextEvent
332
     * @return $this
333
     */
334
    public function setNextEvent($nextEvent)
335
    {
336
        $this->nextEvent = $nextEvent;
337
338
        return $this;
339
    }
340
341
    /**
342
     * Get the cancellation date and time.
343
     *
344
     * @return \DateTime
345
     */
346
    public function getCancellationDate()
347 9
    {
348
        return $this->cancellationDate;
349 9
    }
350
351 9
    /**
352
     * Set the cancellation date and time.
353
     *
354
     * @param \DateTime $cancellationDate The cancellation date and time.
355
     * @return $this
356
     */
357
    public function setCancellationDate($cancellationDate)
358
    {
359 18
        $this->cancellationDate = $cancellationDate;
360
361 18
        return $this;
362
    }
363
364
    /**
365
     * Get the subscription status.
366
     *
367
     * @return string
368
     */
369
    public function getStatus()
370 18
    {
371
        return $this->status;
372 18
    }
373
374 18
    /**
375
     * Set the subscription status.
376
     *
377
     * @param string $status The subscription status.
378
     * @return $this
379
     */
380
    public function setStatus($status)
381
    {
382
        $this->status = $status;
383
384
        return $this;
385
    }
386
387
    /**
388
     * Get the hash.
389
     *
390
     * @return string
391
     */
392
    public function getHash()
393
    {
394
        return $this->hash;
395
    }
396
397
    /**
398
     * Set the hash.
399
     *
400
     * @param string $hash The hash.
401
     * @return $this
402
     */
403
    public function setHash($hash)
404
    {
405
        $this->hash = $hash;
406
407
        return $this;
408
    }
409
410
    /**
411
     * @return array
412
     */
413
    public function getXAttributes()
414
    {
415
        return $this->xAttributes;
416
    }
417
418
    /**
419
     * @param array $xAttributes
420
     * @return $this
421
     */
422
    public function setXAttributes(array $xAttributes)
423
    {
424
        $this->xAttributes = $xAttributes;
425
426
        return $this;
427
    }
428
429
    /**
430
     * @return int
431
     */
432
    public function getArticleNumber()
433 9
    {
434
        return $this->articleNumber;
435 9
    }
436
437 9
    /**
438
     * Set the article number.
439
     *
440
     * @param string $articleNumber The article number.
441
     * @return $this
442
     */
443
    public function setArticleNumber($articleNumber)
444
    {
445
        $this->articleNumber = $articleNumber;
446
447
        return $this;
448
    }
449
450
    /**
451
     * @return integer
452
     */
453
    public function getQuantity()
454
    {
455
        return $this->quantity;
456
    }
457
458
    /**
459
     * Set the quantity.
460
     *
461
     * @param integer $quantity The quantity.
462
     * @return $this
463
     */
464
    public function setQuantity($quantity)
465
    {
466
        $this->quantity = $quantity;
467
468
        return $this;
469
    }
470
471
    /**
472
     * Get the plan.
473
     *
474
     * @return SubscriptionPlanObject
475
     */
476
    public function getPlan()
477
    {
478
        return $this->plan;
479
    }
480
481
    /**
482
     * Set the plan.
483
     *
484
     * @param SubscriptionPlanObject $plan The plan.
485
     * @return $this
486
     */
487
    public function setPlan($plan)
488
    {
489
        $this->plan = $plan;
490
491
        return $this;
492
    }
493
494
    /**
495
     * @return string
496
     */
497
    public function getInvoiceTitle()
498
    {
499
        return $this->invoiceTitle;
500
    }
501
502
    /**
503
     * @param string $invoiceTitle
504
     * @return $this
505
     */
506
    public function setInvoiceTitle($invoiceTitle)
507
    {
508
        $this->invoiceTitle = $invoiceTitle;
509
510
        return $this;
511
    }
512
513
    /**
514
     * Get the coupon for the subscription.
515
     *
516
     * @return Coupon
517
     */
518
    public function getCoupon()
519
    {
520
        return $this->coupon;
521
    }
522
523
    /**
524
     * Set the coupon.
525
     *
526
     * @param Coupon $coupon The coupon to set.
527
     */
528
    public function setCoupon(Coupon $coupon)
529
    {
530
        $this->coupon = $coupon;
531
    }
532
533
    /**
534
     * @return mixed
535
     */
536
    public function getLastEvent()
537
    {
538
        return $this->lastEvent;
539
    }
540
541
    /**
542
     * @param mixed $lastEvent
543
     * @return $this
544
     */
545
    public function setLastEvent($lastEvent)
546
    {
547
        $this->lastEvent = $lastEvent;
548
549
        return $this;
550
    }
551
552
    /**
553
     * @return array
554
     */
555
    public function getAddons()
556
    {
557
        return $this->addons;
558
    }
559
560
    /**
561
     * @param array $addons
562
     * @return $this
563
     */
564
    public function setAddons($addons)
565
    {
566
        $this->addons = $addons;
567
568
        return $this;
569
    }
570
571
    /**
572
     * @return \DateTime
573
     */
574
    public function getExpirationDate()
575
    {
576
        return $this->expirationDate;
577
    }
578
579
    /**
580
     * @param \DateTime $expirationDate
581
     * @return $this
582
     */
583
    public function setExpirationDate($expirationDate)
584
    {
585
        $this->expirationDate = $expirationDate;
586
587
        return $this;
588
    }
589
590
    /**
591
     * @return SubscriptionPlanObject
592
     */
593
    public function getPlanUpcoming()
594
    {
595
        return $this->planUpcoming;
596
    }
597
598
    /**
599
     * @param SubscriptionPlanObject $planUpcoming
600
     * @return $this
601
     */
602
    public function setPlanUpcoming($planUpcoming)
603
    {
604
        $this->planUpcoming = $planUpcoming;
605
606
        return $this;
607
    }
608
609
    /**
610
     * Get the cancellation note.
611
     *
612
     * @return string
613
     */
614
    public function getCancellationNote()
615
    {
616
        return $this->cancellationNote;
617
    }
618
619
    /**
620
     * Set the cancellation note.
621
     *
622
     * @param string $cancellationNote The cancellation note.
623
     * @return $this
624
     */
625
    public function setCancellationNote($cancellationNote)
626
    {
627
        $this->cancellationNote = $cancellationNote;
628
629
        return $this;
630
    }
631
}
632