Completed
Push — master ( 6368d5...c9f46d )
by Joachim
13:28
created

Order::createMoneyFromFloat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Loevgaard\DandomainFoundation\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\ORM\Mapping as ORM;
7
use Knp\DoctrineBehaviors\Model\SoftDeletable\SoftDeletable;
8
use Knp\DoctrineBehaviors\Model\Timestampable\Timestampable;
9
use Loevgaard\DandomainFoundation;
10
use Loevgaard\DandomainFoundation\Entity\Generated\CustomerInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...rated\CustomerInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Loevgaard\DandomainFoundation\Entity\Generated\DeliveryInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...rated\DeliveryInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Loevgaard\DandomainFoundation\Entity\Generated\InvoiceInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...erated\InvoiceInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use Loevgaard\DandomainFoundation\Entity\Generated\OrderInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...enerated\OrderInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use Loevgaard\DandomainFoundation\Entity\Generated\OrderLineInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...ated\OrderLineInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
use Loevgaard\DandomainFoundation\Entity\Generated\OrderTrait;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...ty\Generated\OrderTrait was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
use Loevgaard\DandomainFoundation\Entity\Generated\PaymentMethodInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...\PaymentMethodInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
use Loevgaard\DandomainFoundation\Entity\Generated\ShippingMethodInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...ShippingMethodInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
use Loevgaard\DandomainFoundation\Entity\Generated\SiteInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...Generated\SiteInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
19
use Loevgaard\DandomainFoundation\Entity\Generated\StateInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...enerated\StateInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
20
use Money\Money;
21
22
/**
23
 * We use the Money library for amounts, and we use a shared currency, namely the property $currencyCode
24
 *
25
 * @ORM\Entity()
26
 * @ORM\Table(name="ldf_orders")
27
 */
28
class Order extends AbstractEntity implements OrderInterface
29
{
30
    use OrderTrait;
31
    use Timestampable;
32
    use SoftDeletable;
33
34
    /**
35
     * @var int
36
     *
37
     * @ORM\Id
38
     * @ORM\GeneratedValue
39
     * @ORM\Column(type="integer")
40
     **/
41
    protected $id;
42
43
    /**
44
     * This is the order id in Dandomain
45
     *
46
     * @var int
47
     *
48
     * @ORM\Column(type="integer", unique=true)
49
     */
50
    protected $externalId;
51
52
    /**
53
     * @var CustomerInterface|null
54
     *
55
     * @ORM\JoinColumn(onDelete="SET NULL")
56
     * @ORM\ManyToOne(targetEntity="Customer", cascade={"persist", "remove"})
57
     */
58
    protected $customer;
59
60
    /**
61
     * @var DeliveryInterface|null
62
     *
63
     * @ORM\JoinColumn(onDelete="SET NULL")
64
     * @ORM\ManyToOne(targetEntity="Delivery", cascade={"persist", "remove"})
65
     */
66
    protected $delivery;
67
68
    /**
69
     * @var InvoiceInterface|null
70
     *
71
     * @ORM\JoinColumn(onDelete="SET NULL")
72
     * @ORM\ManyToOne(targetEntity="Invoice", cascade={"persist", "remove"})
73
     */
74
    protected $invoice;
75
76
    /**
77
     * @var OrderLine[]|ArrayCollection
78
     *
79
     * @ORM\OneToMany(mappedBy="order", targetEntity="OrderLine", cascade={"persist", "remove"}, orphanRemoval=true)
80
     */
81
    protected $orderLines;
82
83
    /**
84
     * @var PaymentMethodInterface|null
85
     *
86
     * @ORM\JoinColumn(onDelete="SET NULL")
87
     * @ORM\ManyToOne(targetEntity="PaymentMethod", cascade={"persist", "remove"})
88
     */
89
    protected $paymentMethod;
90
91
    /**
92
     * Because the fee can change on the payment method we have a field for here for the fee on this order
93
     *
94
     * @var integer|null
95
     *
96
     * @ORM\Column(type="integer", nullable=true)
97
     */
98
    protected $paymentMethodFee;
99
100
    /**
101
     * @var ShippingMethodInterface|null
102
     *
103
     * @ORM\JoinColumn(onDelete="SET NULL")
104
     * @ORM\ManyToOne(targetEntity="ShippingMethod", cascade={"persist", "remove"})
105
     */
106
    protected $shippingMethod;
107
108
    /**
109
     * Because the fee can change on the shipping method we have a field for here for the fee on this order
110
     *
111
     * @var integer|null
112
     *
113
     * @ORM\Column(type="integer", nullable=true)
114
     */
115
    protected $shippingMethodFee;
116
117
    /**
118
     * @var SiteInterface|null
119
     *
120
     * @ORM\JoinColumn(onDelete="SET NULL")
121
     * @ORM\ManyToOne(targetEntity="Site", cascade={"persist", "remove"})
122
     */
123
    protected $site;
124
125
    /**
126
     * @var StateInterface|null
127
     *
128
     * @ORM\JoinColumn(onDelete="SET NULL")
129
     * @ORM\ManyToOne(targetEntity="State", cascade={"persist", "remove"})
130
     */
131
    protected $state;
132
133
    /**
134
     * @var string|null
135
     *
136
     * @ORM\Column(nullable=true, type="text")
137
     */
138
    protected $comment;
139
140
    /**
141
     * @var \DateTimeImmutable|null
142
     *
143
     * @ORM\Column(nullable=true, type="datetime_immutable", options={"comment"="Created info from Dandomain"})
144
     */
145
    protected $createdDate;
146
147
    /**
148
     * @var string|null
149
     *
150
     * @ORM\Column(nullable=true, type="string", length=191)
151
     */
152
    protected $creditNoteNumber;
153
154
    /**
155
     * @var string|null
156
     *
157
     * @ORM\Column(type="string", length=3, nullable=true)
158
     */
159
    protected $currencyCode;
160
161
    /**
162
     * @var string|null
163
     *
164
     * @ORM\Column(nullable=true, type="text")
165
     */
166
    protected $customerComment;
167
168
    /**
169
     * @var integer|null
170
     *
171
     * @ORM\Column(type="integer", nullable=true)
172
     */
173
    protected $giftCertificateAmount;
174
175
    /**
176
     * @var string|null
177
     *
178
     * @ORM\Column(nullable=true, type="string", length=191)
179
     */
180
    protected $giftCertificateNumber;
181
182
    /**
183
     * @var bool|null
184
     *
185
     * @ORM\Column(type="boolean", nullable=true)
186
     */
187
    protected $incomplete;
188
189
    /**
190
     * @var string|null
191
     *
192
     * @ORM\Column(nullable=true, type="string", length=191)
193
     */
194
    protected $ip;
195
196
    /**
197
     * @var bool|null
198
     *
199
     * @ORM\Column(type="boolean", nullable=true)
200
     */
201
    protected $modified;
202
203
    /**
204
     * @var \DateTimeImmutable|null
205
     *
206
     * @ORM\Column(nullable=true, type="datetime_immutable", options={"comment"="Modified info from Dandomain"})
207
     */
208
    protected $modifiedDate;
209
210
    /**
211
     * @var string|null
212
     *
213
     * @ORM\Column(nullable=true, type="string", length=191)
214
     */
215
    protected $referenceNumber;
216
217
    /**
218
     * @var string|null
219
     *
220
     * @ORM\Column(nullable=true, type="text")
221
     */
222
    protected $referrer;
223
224
    /**
225
     * @var string|null
226
     *
227
     * @ORM\Column(nullable=true, type="string", length=191)
228
     */
229
    protected $reservedField1;
230
231
    /**
232
     * @var string|null
233
     *
234
     * @ORM\Column(nullable=true, type="string", length=191)
235
     */
236
    protected $reservedField2;
237
238
    /**
239
     * @var string|null
240
     *
241
     * @ORM\Column(nullable=true, type="string", length=191)
242
     */
243
    protected $reservedField3;
244
245
    /**
246
     * @var string|null
247
     *
248
     * @ORM\Column(nullable=true, type="string", length=191)
249
     */
250
    protected $reservedField4;
251
252
    /**
253
     * @var string|null
254
     *
255
     * @ORM\Column(nullable=true, type="string", length=191)
256
     */
257
    protected $reservedField5;
258
259
    /**
260
     * @var int|null
261
     *
262
     * @ORM\Column(type="integer", nullable=true)
263
     */
264
    protected $salesDiscount;
265
266
    /**
267
     * @var int|null
268
     *
269
     * @ORM\Column(type="integer", nullable=true)
270
     */
271
    protected $totalPrice;
272
273
    /**
274
     * @var float|null
275
     *
276
     * @ORM\Column(nullable=true, type="decimal", precision=12, scale=2)
277
     */
278
    protected $totalWeight;
279
280
    /**
281
     * @var string|null
282
     *
283
     * @ORM\Column(nullable=true, type="string", length=191)
284
     */
285
    protected $trackingNumber;
286
287
    /**
288
     * @var int|null
289
     *
290
     * @ORM\Column(nullable=true, type="string", length=191)
291
     */
292
    protected $transactionNumber;
293
294
    /**
295
     * @var float|null
296
     *
297
     * @ORM\Column(nullable=true, type="decimal", precision=5, scale=2)
298
     */
299
    protected $vatPct;
300
301
    /**
302
     * @var string|null
303
     *
304
     * @ORM\Column(nullable=true, type="string", length=191)
305
     */
306
    protected $vatRegNumber;
307
308
    /**
309
     * @var string|null
310
     *
311
     * @ORM\Column(nullable=true, type="text")
312
     */
313
    protected $xmlParams;
314
315
    public function __construct()
316
    {
317
        $this->orderLines = new ArrayCollection();
318
    }
319
320
    /*
321
     * Collection methods
322
     */
323
    public function addOrderLine(OrderLineInterface $orderLine) : OrderInterface
324
    {
325
        if (!$this->hasOrderLine($orderLine)) {
326
            $this->orderLines->add($orderLine);
327
            $orderLine->setOrder($this);
328
        }
329
330
        return $this;
331
    }
332
333
    /**
334
     * @param OrderLineInterface|int $orderLine Either the OrderLineInterface or the external id
335
     * @return bool
336
     */
337
    public function hasOrderLine($orderLine) : bool
338
    {
339
        if ($orderLine instanceof OrderLineInterface) {
340
            $orderLine = $orderLine->getExternalId();
341
        }
342
343
        return $this->orderLines->exists(function ($key, OrderLineInterface $element) use ($orderLine) {
344
            return $element->getExternalId() === $orderLine;
345
        });
346
    }
347
348
    public function removeOrderLine(OrderLineInterface $orderLine) : OrderInterface
349
    {
350
        $this->orderLines->removeElement($orderLine);
351
352
        return $this;
353
    }
354
355
    public function clearOrderLines() : OrderInterface
356
    {
357
        $this->orderLines->clear();
358
359
        return $this;
360
    }
361
362
    /*
363
     * Getters / Setters
364
     */
365
    /**
366
     * @return Money|null
367
     */
368
    public function getTotalPrice() : ?Money
369
    {
370
        return $this->createMoney((int)$this->totalPrice);
371
    }
372
373
    /**
374
     * @param Money $money
375
     * @return OrderInterface
376
     */
377
    public function setTotalPrice(Money $money = null) : OrderInterface
378
    {
379
        $this->totalPrice = $money->getAmount();
0 ignored issues
show
Bug introduced by
The method getAmount() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

379
        /** @scrutinizer ignore-call */ 
380
        $this->totalPrice = $money->getAmount();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Documentation Bug introduced by
It seems like $money->getAmount() of type string is incompatible with the declared type null|integer of property $totalPrice.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
380
381
        return $this;
382
    }
383
384
    /**
385
     * @return Money|null
386
     */
387
    public function getSalesDiscount() : ?Money
388
    {
389
        return $this->createMoney((int)$this->salesDiscount);
390
    }
391
392
    /**
393
     * @param Money $money
394
     * @return OrderInterface
395
     */
396
    public function setSalesDiscount(Money $money = null) : OrderInterface
397
    {
398
        $this->salesDiscount = $money->getAmount();
0 ignored issues
show
Documentation Bug introduced by
It seems like $money->getAmount() of type string is incompatible with the declared type null|integer of property $salesDiscount.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
399
400
        return $this;
401
    }
402
403
    /**
404
     * @return Money|null
405
     */
406
    public function getGiftCertificateAmount() : ?Money
407
    {
408
        return $this->createMoney((int)$this->giftCertificateAmount);
409
    }
410
411
    /**
412
     * @param Money $money
413
     * @return OrderInterface
414
     */
415
    public function setGiftCertificateAmount(Money $money = null) : OrderInterface
416
    {
417
        $this->giftCertificateAmount = $money->getAmount();
0 ignored issues
show
Documentation Bug introduced by
It seems like $money->getAmount() of type string is incompatible with the declared type null|integer of property $giftCertificateAmount.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
418
419
        return $this;
420
    }
421
422
    /**
423
     * @return Money|null
424
     */
425
    public function getShippingMethodFee() : ?Money
426
    {
427
        return $this->createMoney((int)$this->shippingMethodFee);
428
    }
429
430
    /**
431
     * @param Money $money
432
     * @return OrderInterface
433
     */
434
    public function setShippingMethodFee(Money $money = null) : OrderInterface
435
    {
436
        $this->shippingMethodFee = $money->getAmount();
0 ignored issues
show
Documentation Bug introduced by
It seems like $money->getAmount() of type string is incompatible with the declared type null|integer of property $shippingMethodFee.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
437
438
        return $this;
439
    }
440
441
    /**
442
     * @return Money|null
443
     */
444
    public function getPaymentMethodFee() : ?Money
445
    {
446
        return $this->createMoney((int)$this->paymentMethodFee);
447
    }
448
449
    /**
450
     * @param Money $money
451
     * @return OrderInterface
452
     */
453
    public function setPaymentMethodFee(Money $money = null) : OrderInterface
454
    {
455
        $this->paymentMethodFee = $money->getAmount();
0 ignored issues
show
Documentation Bug introduced by
It seems like $money->getAmount() of type string is incompatible with the declared type null|integer of property $paymentMethodFee.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
456
457
        return $this;
458
    }
459
460
    /**
461
     * @return int
462
     */
463
    public function getId(): int
464
    {
465
        return (int)$this->id;
466
    }
467
468
    /**
469
     * @param int $id
470
     * @return OrderInterface
471
     */
472
    public function setId($id)
473
    {
474
        $this->id = $id;
475
        return $this;
476
    }
477
478
    /**
479
     * @return int
480
     */
481
    public function getExternalId(): int
482
    {
483
        return $this->externalId;
484
    }
485
486
    /**
487
     * @param int $externalId
488
     * @return OrderInterface
489
     */
490
    public function setExternalId($externalId)
491
    {
492
        $this->externalId = $externalId;
493
        return $this;
494
    }
495
496
    /**
497
     * @return CustomerInterface|null
498
     */
499
    public function getCustomer()
500
    {
501
        return $this->customer;
502
    }
503
504
    /**
505
     * @param CustomerInterface|null $customer
506
     * @return OrderInterface
507
     */
508
    public function setCustomer($customer)
509
    {
510
        $this->customer = $customer;
511
        return $this;
512
    }
513
514
    /**
515
     * @return DeliveryInterface|null
516
     */
517
    public function getDelivery()
518
    {
519
        return $this->delivery;
520
    }
521
522
    /**
523
     * @param DeliveryInterface|null $delivery
524
     * @return OrderInterface
525
     */
526
    public function setDelivery($delivery)
527
    {
528
        $this->delivery = $delivery;
529
        return $this;
530
    }
531
532
    /**
533
     * @return InvoiceInterface|null
534
     */
535
    public function getInvoice()
536
    {
537
        return $this->invoice;
538
    }
539
540
    /**
541
     * @param InvoiceInterface|null $invoice
542
     * @return OrderInterface
543
     */
544
    public function setInvoice($invoice)
545
    {
546
        $this->invoice = $invoice;
547
        return $this;
548
    }
549
550
    /**
551
     * @return ArrayCollection|null
552
     */
553
    public function getOrderLines()
554
    {
555
        return $this->orderLines;
556
    }
557
558
    /**
559
     * @param ArrayCollection|null $orderLines
560
     * @return OrderInterface
561
     */
562
    public function setOrderLines($orderLines)
563
    {
564
        $this->orderLines = $orderLines;
565
        return $this;
566
    }
567
568
    /**
569
     * @return PaymentMethodInterface|null
570
     */
571
    public function getPaymentMethod()
572
    {
573
        return $this->paymentMethod;
574
    }
575
576
    /**
577
     * @param PaymentMethodInterface|null $paymentMethod
578
     * @return OrderInterface
579
     */
580
    public function setPaymentMethod($paymentMethod)
581
    {
582
        $this->paymentMethod = $paymentMethod;
583
        return $this;
584
    }
585
586
    /**
587
     * @return ShippingMethodInterface|null
588
     */
589
    public function getShippingMethod()
590
    {
591
        return $this->shippingMethod;
592
    }
593
594
    /**
595
     * @param ShippingMethodInterface|null $shippingMethod
596
     * @return OrderInterface
597
     */
598
    public function setShippingMethod($shippingMethod)
599
    {
600
        $this->shippingMethod = $shippingMethod;
601
        return $this;
602
    }
603
604
    /**
605
     * @return SiteInterface|null
606
     */
607
    public function getSite()
608
    {
609
        return $this->site;
610
    }
611
612
    /**
613
     * @param SiteInterface|null $site
614
     * @return OrderInterface
615
     */
616
    public function setSite($site)
617
    {
618
        $this->site = $site;
619
        return $this;
620
    }
621
622
    /**
623
     * @return StateInterface|null
624
     */
625
    public function getState()
626
    {
627
        return $this->state;
628
    }
629
630
    /**
631
     * @param StateInterface|null $state
632
     * @return OrderInterface
633
     */
634
    public function setState($state)
635
    {
636
        $this->state = $state;
637
        return $this;
638
    }
639
640
    /**
641
     * @return null|string
642
     */
643
    public function getComment()
644
    {
645
        return $this->comment;
646
    }
647
648
    /**
649
     * @param null|string $comment
650
     * @return OrderInterface
651
     */
652
    public function setComment($comment)
653
    {
654
        $this->comment = $comment;
655
        return $this;
656
    }
657
658
    /**
659
     * @return \DateTimeImmutable|null
660
     */
661
    public function getCreatedDate()
662
    {
663
        return $this->createdDate;
664
    }
665
666
    /**
667
     * @param \DateTimeImmutable|null $createdDate
668
     * @return OrderInterface
669
     */
670
    public function setCreatedDate($createdDate)
671
    {
672
        $this->createdDate = $createdDate;
673
        return $this;
674
    }
675
676
    /**
677
     * @return null|string
678
     */
679
    public function getCreditNoteNumber()
680
    {
681
        return $this->creditNoteNumber;
682
    }
683
684
    /**
685
     * @param null|string $creditNoteNumber
686
     * @return Order
687
     */
688
    public function setCreditNoteNumber($creditNoteNumber)
689
    {
690
        $this->creditNoteNumber = $creditNoteNumber;
691
        return $this;
692
    }
693
694
    /**
695
     * @return null|string
696
     */
697
    public function getCurrencyCode()
698
    {
699
        return $this->currencyCode;
700
    }
701
702
    /**
703
     * @param null|string $currencyCode
704
     * @return OrderInterface
705
     */
706
    public function setCurrencyCode($currencyCode)
707
    {
708
        $this->currencyCode = $currencyCode;
709
        return $this;
710
    }
711
712
    /**
713
     * @return null|string
714
     */
715
    public function getCustomerComment()
716
    {
717
        return $this->customerComment;
718
    }
719
720
    /**
721
     * @param null|string $customerComment
722
     * @return OrderInterface
723
     */
724
    public function setCustomerComment($customerComment)
725
    {
726
        $this->customerComment = $customerComment;
727
        return $this;
728
    }
729
730
    /**
731
     * @return null|string
732
     */
733
    public function getGiftCertificateNumber()
734
    {
735
        return $this->giftCertificateNumber;
736
    }
737
738
    /**
739
     * @param null|string $giftCertificateNumber
740
     * @return OrderInterface
741
     */
742
    public function setGiftCertificateNumber($giftCertificateNumber)
743
    {
744
        $this->giftCertificateNumber = $giftCertificateNumber;
745
        return $this;
746
    }
747
748
    /**
749
     * @return bool|null
750
     */
751
    public function getIncomplete()
752
    {
753
        return $this->incomplete;
754
    }
755
756
    /**
757
     * @param bool|null $incomplete
758
     * @return OrderInterface
759
     */
760
    public function setIncomplete($incomplete)
761
    {
762
        $this->incomplete = $incomplete;
763
        return $this;
764
    }
765
766
    /**
767
     * @return null|string
768
     */
769
    public function getIp()
770
    {
771
        return $this->ip;
772
    }
773
774
    /**
775
     * @param null|string $ip
776
     * @return OrderInterface
777
     */
778
    public function setIp($ip)
779
    {
780
        $this->ip = $ip;
781
        return $this;
782
    }
783
784
    /**
785
     * @return bool|null
786
     */
787
    public function getModified()
788
    {
789
        return $this->modified;
790
    }
791
792
    /**
793
     * @param bool|null $modified
794
     * @return OrderInterface
795
     */
796
    public function setModified($modified)
797
    {
798
        $this->modified = $modified;
799
        return $this;
800
    }
801
802
    /**
803
     * @return \DateTimeImmutable|null
804
     */
805
    public function getModifiedDate()
806
    {
807
        return $this->modifiedDate;
808
    }
809
810
    /**
811
     * @param \DateTimeImmutable|null $modifiedDate
812
     * @return OrderInterface
813
     */
814
    public function setModifiedDate($modifiedDate)
815
    {
816
        $this->modifiedDate = $modifiedDate;
817
        return $this;
818
    }
819
820
    /**
821
     * @return null|string
822
     */
823
    public function getReferenceNumber()
824
    {
825
        return $this->referenceNumber;
826
    }
827
828
    /**
829
     * @param null|string $referenceNumber
830
     * @return OrderInterface
831
     */
832
    public function setReferenceNumber($referenceNumber)
833
    {
834
        $this->referenceNumber = $referenceNumber;
835
        return $this;
836
    }
837
838
    /**
839
     * @return null|string
840
     */
841
    public function getReferrer()
842
    {
843
        return $this->referrer;
844
    }
845
846
    /**
847
     * @param null|string $referrer
848
     * @return OrderInterface
849
     */
850
    public function setReferrer($referrer)
851
    {
852
        $this->referrer = $referrer;
853
        return $this;
854
    }
855
856
    /**
857
     * @return null|string
858
     */
859
    public function getReservedField1()
860
    {
861
        return $this->reservedField1;
862
    }
863
864
    /**
865
     * @param null|string $reservedField1
866
     * @return OrderInterface
867
     */
868
    public function setReservedField1($reservedField1)
869
    {
870
        $this->reservedField1 = $reservedField1;
871
        return $this;
872
    }
873
874
    /**
875
     * @return null|string
876
     */
877
    public function getReservedField2()
878
    {
879
        return $this->reservedField2;
880
    }
881
882
    /**
883
     * @param null|string $reservedField2
884
     * @return OrderInterface
885
     */
886
    public function setReservedField2($reservedField2)
887
    {
888
        $this->reservedField2 = $reservedField2;
889
        return $this;
890
    }
891
892
    /**
893
     * @return null|string
894
     */
895
    public function getReservedField3()
896
    {
897
        return $this->reservedField3;
898
    }
899
900
    /**
901
     * @param null|string $reservedField3
902
     * @return OrderInterface
903
     */
904
    public function setReservedField3($reservedField3)
905
    {
906
        $this->reservedField3 = $reservedField3;
907
        return $this;
908
    }
909
910
    /**
911
     * @return null|string
912
     */
913
    public function getReservedField4()
914
    {
915
        return $this->reservedField4;
916
    }
917
918
    /**
919
     * @param null|string $reservedField4
920
     * @return OrderInterface
921
     */
922
    public function setReservedField4($reservedField4)
923
    {
924
        $this->reservedField4 = $reservedField4;
925
        return $this;
926
    }
927
928
    /**
929
     * @return null|string
930
     */
931
    public function getReservedField5()
932
    {
933
        return $this->reservedField5;
934
    }
935
936
    /**
937
     * @param null|string $reservedField5
938
     * @return OrderInterface
939
     */
940
    public function setReservedField5($reservedField5)
941
    {
942
        $this->reservedField5 = $reservedField5;
943
        return $this;
944
    }
945
946
    /**
947
     * @return float|null
948
     */
949
    public function getTotalWeight()
950
    {
951
        return $this->totalWeight;
952
    }
953
954
    /**
955
     * @param float|null $totalWeight
956
     * @return OrderInterface
957
     */
958
    public function setTotalWeight($totalWeight)
959
    {
960
        $this->totalWeight = $totalWeight;
961
        return $this;
962
    }
963
964
    /**
965
     * @return null|string
966
     */
967
    public function getTrackingNumber()
968
    {
969
        return $this->trackingNumber;
970
    }
971
972
    /**
973
     * @param null|string $trackingNumber
974
     * @return OrderInterface
975
     */
976
    public function setTrackingNumber($trackingNumber)
977
    {
978
        $this->trackingNumber = $trackingNumber;
979
        return $this;
980
    }
981
982
    /**
983
     * @return int|null
984
     */
985
    public function getTransactionNumber()
986
    {
987
        return $this->transactionNumber;
988
    }
989
990
    /**
991
     * @param int|null $transactionNumber
992
     * @return OrderInterface
993
     */
994
    public function setTransactionNumber($transactionNumber)
995
    {
996
        $this->transactionNumber = $transactionNumber;
997
        return $this;
998
    }
999
1000
    /**
1001
     * @return float|null
1002
     */
1003
    public function getVatPct()
1004
    {
1005
        return $this->vatPct;
1006
    }
1007
1008
    /**
1009
     * @param float|null $vatPct
1010
     * @return OrderInterface
1011
     */
1012
    public function setVatPct($vatPct)
1013
    {
1014
        $this->vatPct = $vatPct;
1015
        return $this;
1016
    }
1017
1018
    /**
1019
     * @return null|string
1020
     */
1021
    public function getVatRegNumber()
1022
    {
1023
        return $this->vatRegNumber;
1024
    }
1025
1026
    /**
1027
     * @param null|string $vatRegNumber
1028
     * @return OrderInterface
1029
     */
1030
    public function setVatRegNumber($vatRegNumber)
1031
    {
1032
        $this->vatRegNumber = $vatRegNumber;
1033
        return $this;
1034
    }
1035
1036
    /**
1037
     * @return null|string
1038
     */
1039
    public function getXmlParams()
1040
    {
1041
        return $this->xmlParams;
1042
    }
1043
1044
    /**
1045
     * @param null|string $xmlParams
1046
     * @return OrderInterface
1047
     */
1048
    public function setXmlParams($xmlParams)
1049
    {
1050
        $this->xmlParams = $xmlParams;
1051
        return $this;
1052
    }
1053
1054
    /**
1055
     * A helper method for creating a Money object from a float based on the shared currency
1056
     *
1057
     * @param int $amount
1058
     * @return Money|null
1059
     */
1060
    private function createMoney(int $amount = 0) : ?Money
1061
    {
1062
        return DandomainFoundation\createMoney((string)$this->currencyCode, $amount);
1063
    }
1064
}
1065