Total Complexity | 92 |
Total Lines | 1152 |
Duplicated Lines | 0 % |
Changes | 0 |
Complex classes like Order often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Order, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
27 | class Order extends AbstractEntity implements OrderInterface |
||
28 | { |
||
29 | use OrderTrait; |
||
30 | |||
31 | /** |
||
32 | * @var int |
||
33 | * |
||
34 | * @ORM\Id |
||
35 | * @ORM\GeneratedValue |
||
36 | * @ORM\Column(type="integer") |
||
37 | **/ |
||
38 | protected $id; |
||
39 | |||
40 | /** |
||
41 | * This is the order id in Dandomain |
||
42 | * |
||
43 | * @var int |
||
44 | * |
||
45 | * @ORM\Column(type="integer", unique=true) |
||
46 | */ |
||
47 | protected $externalId; |
||
48 | |||
49 | /** |
||
50 | * @var CustomerInterface|null |
||
51 | * |
||
52 | * @ORM\JoinColumn(onDelete="SET NULL") |
||
53 | * @ORM\ManyToOne(targetEntity="Customer", cascade={"persist", "remove"}) |
||
54 | */ |
||
55 | protected $customer; |
||
56 | |||
57 | /** |
||
58 | * @var DeliveryInterface|null |
||
59 | * |
||
60 | * @ORM\JoinColumn(onDelete="SET NULL") |
||
61 | * @ORM\ManyToOne(targetEntity="Delivery", cascade={"persist", "remove"}) |
||
62 | */ |
||
63 | protected $delivery; |
||
64 | |||
65 | /** |
||
66 | * @var InvoiceInterface|null |
||
67 | * |
||
68 | * @ORM\JoinColumn(onDelete="SET NULL") |
||
69 | * @ORM\ManyToOne(targetEntity="Invoice", cascade={"persist", "remove"}) |
||
70 | */ |
||
71 | protected $invoice; |
||
72 | |||
73 | /** |
||
74 | * @var OrderLine[]|ArrayCollection |
||
75 | * |
||
76 | * @ORM\OneToMany(mappedBy="order", targetEntity="OrderLine", cascade={"persist", "remove"}) |
||
77 | */ |
||
78 | protected $orderLines; |
||
79 | |||
80 | /** |
||
81 | * @var PaymentMethodInterface|null |
||
82 | * |
||
83 | * @ORM\JoinColumn(onDelete="SET NULL") |
||
84 | * @ORM\ManyToOne(targetEntity="PaymentMethod", cascade={"persist", "remove"}) |
||
85 | */ |
||
86 | protected $paymentMethod; |
||
87 | |||
88 | /** |
||
89 | * Because the fee can change on the payment method we have a field for here for the fee on this order |
||
90 | * |
||
91 | * @var integer|null |
||
92 | * |
||
93 | * @ORM\Column(type="integer", nullable=true) |
||
94 | */ |
||
95 | protected $paymentMethodFee; |
||
96 | |||
97 | /** |
||
98 | * @var ShippingMethodInterface|null |
||
99 | * |
||
100 | * @ORM\JoinColumn(onDelete="SET NULL") |
||
101 | * @ORM\ManyToOne(targetEntity="ShippingMethod", cascade={"persist", "remove"}) |
||
102 | */ |
||
103 | protected $shippingMethod; |
||
104 | |||
105 | /** |
||
106 | * Because the fee can change on the shipping method we have a field for here for the fee on this order |
||
107 | * |
||
108 | * @var integer|null |
||
109 | * |
||
110 | * @ORM\Column(type="integer", nullable=true) |
||
111 | */ |
||
112 | protected $shippingMethodFee; |
||
113 | |||
114 | /** |
||
115 | * @var SiteInterface|null |
||
116 | * |
||
117 | * @ORM\JoinColumn(onDelete="SET NULL") |
||
118 | * @ORM\ManyToOne(targetEntity="Site", cascade={"persist", "remove"}) |
||
119 | */ |
||
120 | protected $site; |
||
121 | |||
122 | /** |
||
123 | * @var StateInterface|null |
||
124 | * |
||
125 | * @ORM\JoinColumn(onDelete="SET NULL") |
||
126 | * @ORM\ManyToOne(targetEntity="State", cascade={"persist", "remove"}) |
||
127 | */ |
||
128 | protected $state; |
||
129 | |||
130 | /** |
||
131 | * @var string|null |
||
132 | * |
||
133 | * @ORM\Column(nullable=true, type="text") |
||
134 | */ |
||
135 | protected $comment; |
||
136 | |||
137 | /** |
||
138 | * @var \DateTimeImmutable|null |
||
139 | * |
||
140 | * @ORM\Column(nullable=true, type="datetime_immutable") |
||
141 | */ |
||
142 | protected $createdDate; |
||
143 | |||
144 | /** |
||
145 | * @var string|null |
||
146 | * |
||
147 | * @ORM\Column(nullable=true, type="string", length=191) |
||
148 | */ |
||
149 | protected $creditNoteNumber; |
||
150 | |||
151 | /** |
||
152 | * @var string|null |
||
153 | * |
||
154 | * @ORM\Column(type="string", length=3, nullable=true) |
||
155 | */ |
||
156 | protected $currencyCode; |
||
157 | |||
158 | /** |
||
159 | * @var string|null |
||
160 | * |
||
161 | * @ORM\Column(nullable=true, type="text") |
||
162 | */ |
||
163 | protected $customerComment; |
||
164 | |||
165 | /** |
||
166 | * @var integer|null |
||
167 | * |
||
168 | * @ORM\Column(type="integer", nullable=true) |
||
169 | */ |
||
170 | protected $giftCertificateAmount; |
||
171 | |||
172 | /** |
||
173 | * @var string|null |
||
174 | * |
||
175 | * @ORM\Column(nullable=true, type="string", length=191) |
||
176 | */ |
||
177 | protected $giftCertificateNumber; |
||
178 | |||
179 | /** |
||
180 | * @var bool|null |
||
181 | * |
||
182 | * @ORM\Column(type="boolean", nullable=true) |
||
183 | */ |
||
184 | protected $incomplete; |
||
185 | |||
186 | /** |
||
187 | * @var string|null |
||
188 | * |
||
189 | * @ORM\Column(nullable=true, type="string", length=191) |
||
190 | */ |
||
191 | protected $ip; |
||
192 | |||
193 | /** |
||
194 | * @var bool|null |
||
195 | * |
||
196 | * @ORM\Column(type="boolean", nullable=true) |
||
197 | */ |
||
198 | protected $modified; |
||
199 | |||
200 | /** |
||
201 | * @var \DateTimeImmutable|null |
||
202 | * |
||
203 | * @ORM\Column(nullable=true, type="datetime_immutable") |
||
204 | */ |
||
205 | protected $modifiedDate; |
||
206 | |||
207 | /** |
||
208 | * @var string|null |
||
209 | * |
||
210 | * @ORM\Column(nullable=true, type="string", length=191) |
||
211 | */ |
||
212 | protected $referenceNumber; |
||
213 | |||
214 | /** |
||
215 | * @var string|null |
||
216 | * |
||
217 | * @ORM\Column(nullable=true, type="string", length=191) |
||
218 | */ |
||
219 | protected $referrer; |
||
220 | |||
221 | /** |
||
222 | * @var string|null |
||
223 | * |
||
224 | * @ORM\Column(nullable=true, type="string", length=191) |
||
225 | */ |
||
226 | protected $reservedField1; |
||
227 | |||
228 | /** |
||
229 | * @var string|null |
||
230 | * |
||
231 | * @ORM\Column(nullable=true, type="string", length=191) |
||
232 | */ |
||
233 | protected $reservedField2; |
||
234 | |||
235 | /** |
||
236 | * @var string|null |
||
237 | * |
||
238 | * @ORM\Column(nullable=true, type="string", length=191) |
||
239 | */ |
||
240 | protected $reservedField3; |
||
241 | |||
242 | /** |
||
243 | * @var string|null |
||
244 | * |
||
245 | * @ORM\Column(nullable=true, type="string", length=191) |
||
246 | */ |
||
247 | protected $reservedField4; |
||
248 | |||
249 | /** |
||
250 | * @var string|null |
||
251 | * |
||
252 | * @ORM\Column(nullable=true, type="string", length=191) |
||
253 | */ |
||
254 | protected $reservedField5; |
||
255 | |||
256 | /** |
||
257 | * @var int|null |
||
258 | * |
||
259 | * @ORM\Column(type="integer", nullable=true) |
||
260 | */ |
||
261 | protected $salesDiscount; |
||
262 | |||
263 | /** |
||
264 | * @var int|null |
||
265 | * |
||
266 | * @ORM\Column(type="integer", nullable=true) |
||
267 | */ |
||
268 | protected $totalPrice; |
||
269 | |||
270 | /** |
||
271 | * @var float|null |
||
272 | * |
||
273 | * @ORM\Column(nullable=true, type="decimal", precision=12, scale=2) |
||
274 | */ |
||
275 | protected $totalWeight; |
||
276 | |||
277 | /** |
||
278 | * @var string|null |
||
279 | * |
||
280 | * @ORM\Column(nullable=true, type="string", length=191) |
||
281 | */ |
||
282 | protected $trackingNumber; |
||
283 | |||
284 | /** |
||
285 | * @var int|null |
||
286 | * |
||
287 | * @ORM\Column(nullable=true, type="string", length=191) |
||
288 | */ |
||
289 | protected $transactionNumber; |
||
290 | |||
291 | /** |
||
292 | * @var float|null |
||
293 | * |
||
294 | * @ORM\Column(nullable=true, type="decimal", precision=5, scale=2) |
||
295 | */ |
||
296 | protected $vatPct; |
||
297 | |||
298 | /** |
||
299 | * @var string|null |
||
300 | * |
||
301 | * @ORM\Column(nullable=true, type="string", length=191) |
||
302 | */ |
||
303 | protected $vatRegNumber; |
||
304 | |||
305 | /** |
||
306 | * @var string|null |
||
307 | * |
||
308 | * @ORM\Column(nullable=true, type="text") |
||
309 | */ |
||
310 | protected $xmlParams; |
||
311 | |||
312 | public function __construct() |
||
315 | } |
||
316 | |||
317 | /** |
||
318 | * Populates an order based on the response from the Dandomain API |
||
319 | * |
||
320 | * See the properties here: |
||
321 | * http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/OrderService/help/operations/GetOrder |
||
322 | * |
||
323 | * @param \stdClass|array $data |
||
324 | * @param bool $populateEmbedded |
||
325 | * @return OrderInterface |
||
326 | */ |
||
327 | public function populateFromApiResponse($data, bool $populateEmbedded = false) : OrderInterface |
||
439 | } |
||
440 | |||
441 | /* |
||
442 | * Collection methods |
||
443 | */ |
||
444 | public function addOrderLine(OrderLineInterface $orderLine) : OrderInterface |
||
445 | { |
||
446 | if(!$this->hasOrderLine($orderLine)) { |
||
447 | $this->orderLines->add($orderLine); |
||
448 | $orderLine->setOrder($this); |
||
449 | } |
||
450 | return $this; |
||
451 | } |
||
452 | |||
453 | public function hasOrderLine(OrderLineInterface $orderLine) : bool |
||
457 | }); |
||
458 | } |
||
459 | |||
460 | public function removeOrderLine(OrderLineInterface $orderLine) : OrderInterface |
||
461 | { |
||
462 | $orderLine->setOrder(null); |
||
463 | $this->orderLines->removeElement($orderLine); |
||
464 | return $this; |
||
465 | } |
||
466 | |||
467 | /* |
||
468 | * Getters / Setters |
||
469 | */ |
||
470 | /** |
||
471 | * @return Money|null |
||
472 | */ |
||
473 | public function getTotalPrice() : ?Money |
||
474 | { |
||
475 | return $this->createMoney((int)$this->totalPrice); |
||
476 | } |
||
477 | |||
478 | /** |
||
479 | * @param Money $money |
||
480 | * @return OrderInterface |
||
481 | */ |
||
482 | public function setTotalPrice(Money $money = null) : OrderInterface |
||
483 | { |
||
484 | $this->totalPrice = $money->getAmount(); |
||
485 | |||
486 | return $this; |
||
487 | } |
||
488 | |||
489 | /** |
||
490 | * @return Money|null |
||
491 | */ |
||
492 | public function getSalesDiscount() : ?Money |
||
493 | { |
||
494 | return $this->createMoney((int)$this->salesDiscount); |
||
495 | } |
||
496 | |||
497 | /** |
||
498 | * @param Money $money |
||
499 | * @return OrderInterface |
||
500 | */ |
||
501 | public function setSalesDiscount(Money $money = null) : OrderInterface |
||
502 | { |
||
503 | $this->salesDiscount = $money->getAmount(); |
||
504 | |||
505 | return $this; |
||
506 | } |
||
507 | |||
508 | /** |
||
509 | * @return Money|null |
||
510 | */ |
||
511 | public function getGiftCertificateAmount() : ?Money |
||
512 | { |
||
513 | return $this->createMoney((int)$this->giftCertificateAmount); |
||
514 | } |
||
515 | |||
516 | /** |
||
517 | * @param Money $money |
||
518 | * @return OrderInterface |
||
519 | */ |
||
520 | public function setGiftCertificateAmount(Money $money = null) : OrderInterface |
||
521 | { |
||
522 | $this->giftCertificateAmount = $money->getAmount(); |
||
523 | |||
524 | return $this; |
||
525 | } |
||
526 | |||
527 | /** |
||
528 | * @return Money|null |
||
529 | */ |
||
530 | public function getShippingMethodFee() : ?Money |
||
531 | { |
||
532 | return $this->createMoney((int)$this->shippingMethodFee); |
||
533 | } |
||
534 | |||
535 | /** |
||
536 | * @param Money $money |
||
537 | * @return OrderInterface |
||
538 | */ |
||
539 | public function setShippingMethodFee(Money $money = null) : OrderInterface |
||
540 | { |
||
541 | $this->shippingMethodFee = $money->getAmount(); |
||
542 | |||
543 | return $this; |
||
544 | } |
||
545 | |||
546 | /** |
||
547 | * @return Money|null |
||
548 | */ |
||
549 | public function getPaymentMethodFee() : ?Money |
||
550 | { |
||
551 | return $this->createMoney((int)$this->paymentMethodFee); |
||
552 | } |
||
553 | |||
554 | /** |
||
555 | * @param Money $money |
||
556 | * @return OrderInterface |
||
557 | */ |
||
558 | public function setPaymentMethodFee(Money $money = null) : OrderInterface |
||
559 | { |
||
560 | $this->paymentMethodFee = $money->getAmount(); |
||
561 | |||
562 | return $this; |
||
563 | } |
||
564 | |||
565 | /** |
||
566 | * @return int |
||
567 | */ |
||
568 | public function getId(): int |
||
569 | { |
||
570 | return (int)$this->id; |
||
571 | } |
||
572 | |||
573 | /** |
||
574 | * @param int $id |
||
575 | * @return OrderInterface |
||
576 | */ |
||
577 | public function setId($id) |
||
578 | { |
||
579 | $this->id = $id; |
||
580 | return $this; |
||
581 | } |
||
582 | |||
583 | /** |
||
584 | * @return int |
||
585 | */ |
||
586 | public function getExternalId(): int |
||
587 | { |
||
588 | return $this->externalId; |
||
589 | } |
||
590 | |||
591 | /** |
||
592 | * @param int $externalId |
||
593 | * @return OrderInterface |
||
594 | */ |
||
595 | public function setExternalId($externalId) |
||
596 | { |
||
597 | $this->externalId = $externalId; |
||
598 | return $this; |
||
599 | } |
||
600 | |||
601 | /** |
||
602 | * @return CustomerInterface|null |
||
603 | */ |
||
604 | public function getCustomer() |
||
605 | { |
||
606 | return $this->customer; |
||
607 | } |
||
608 | |||
609 | /** |
||
610 | * @param CustomerInterface|null $customer |
||
611 | * @return OrderInterface |
||
612 | */ |
||
613 | public function setCustomer($customer) |
||
614 | { |
||
615 | $this->customer = $customer; |
||
616 | return $this; |
||
617 | } |
||
618 | |||
619 | /** |
||
620 | * @return DeliveryInterface|null |
||
621 | */ |
||
622 | public function getDelivery() |
||
623 | { |
||
624 | return $this->delivery; |
||
625 | } |
||
626 | |||
627 | /** |
||
628 | * @param DeliveryInterface|null $delivery |
||
629 | * @return OrderInterface |
||
630 | */ |
||
631 | public function setDelivery($delivery) |
||
632 | { |
||
633 | $this->delivery = $delivery; |
||
634 | return $this; |
||
635 | } |
||
636 | |||
637 | /** |
||
638 | * @return InvoiceInterface|null |
||
639 | */ |
||
640 | public function getInvoice() |
||
641 | { |
||
642 | return $this->invoice; |
||
643 | } |
||
644 | |||
645 | /** |
||
646 | * @param InvoiceInterface|null $invoice |
||
647 | * @return OrderInterface |
||
648 | */ |
||
649 | public function setInvoice($invoice) |
||
650 | { |
||
651 | $this->invoice = $invoice; |
||
652 | return $this; |
||
653 | } |
||
654 | |||
655 | /** |
||
656 | * @return ArrayCollection|null |
||
657 | */ |
||
658 | public function getOrderLines() |
||
659 | { |
||
660 | return $this->orderLines; |
||
661 | } |
||
662 | |||
663 | /** |
||
664 | * @param ArrayCollection|null $orderLines |
||
665 | * @return OrderInterface |
||
666 | */ |
||
667 | public function setOrderLines($orderLines) |
||
668 | { |
||
669 | $this->orderLines = $orderLines; |
||
670 | return $this; |
||
671 | } |
||
672 | |||
673 | /** |
||
674 | * @return PaymentMethodInterface|null |
||
675 | */ |
||
676 | public function getPaymentMethod() |
||
677 | { |
||
678 | return $this->paymentMethod; |
||
679 | } |
||
680 | |||
681 | /** |
||
682 | * @param PaymentMethodInterface|null $paymentMethod |
||
683 | * @return OrderInterface |
||
684 | */ |
||
685 | public function setPaymentMethod($paymentMethod) |
||
686 | { |
||
687 | $this->paymentMethod = $paymentMethod; |
||
688 | return $this; |
||
689 | } |
||
690 | |||
691 | /** |
||
692 | * @return ShippingMethodInterface|null |
||
693 | */ |
||
694 | public function getShippingMethod() |
||
695 | { |
||
696 | return $this->shippingMethod; |
||
697 | } |
||
698 | |||
699 | /** |
||
700 | * @param ShippingMethodInterface|null $shippingMethod |
||
701 | * @return OrderInterface |
||
702 | */ |
||
703 | public function setShippingMethod($shippingMethod) |
||
704 | { |
||
705 | $this->shippingMethod = $shippingMethod; |
||
706 | return $this; |
||
707 | } |
||
708 | |||
709 | /** |
||
710 | * @return SiteInterface|null |
||
711 | */ |
||
712 | public function getSite() |
||
713 | { |
||
714 | return $this->site; |
||
715 | } |
||
716 | |||
717 | /** |
||
718 | * @param SiteInterface|null $site |
||
719 | * @return OrderInterface |
||
720 | */ |
||
721 | public function setSite($site) |
||
722 | { |
||
723 | $this->site = $site; |
||
724 | return $this; |
||
725 | } |
||
726 | |||
727 | /** |
||
728 | * @return StateInterface|null |
||
729 | */ |
||
730 | public function getState() |
||
731 | { |
||
732 | return $this->state; |
||
733 | } |
||
734 | |||
735 | /** |
||
736 | * @param StateInterface|null $state |
||
737 | * @return OrderInterface |
||
738 | */ |
||
739 | public function setState($state) |
||
740 | { |
||
741 | $this->state = $state; |
||
742 | return $this; |
||
743 | } |
||
744 | |||
745 | /** |
||
746 | * @return null|string |
||
747 | */ |
||
748 | public function getComment() |
||
749 | { |
||
750 | return $this->comment; |
||
751 | } |
||
752 | |||
753 | /** |
||
754 | * @param null|string $comment |
||
755 | * @return OrderInterface |
||
756 | */ |
||
757 | public function setComment($comment) |
||
758 | { |
||
759 | $this->comment = $comment; |
||
760 | return $this; |
||
761 | } |
||
762 | |||
763 | /** |
||
764 | * @return \DateTimeImmutable|null |
||
765 | */ |
||
766 | public function getCreatedDate() |
||
767 | { |
||
768 | return $this->createdDate; |
||
769 | } |
||
770 | |||
771 | /** |
||
772 | * @param \DateTimeImmutable|null $createdDate |
||
773 | * @return OrderInterface |
||
774 | */ |
||
775 | public function setCreatedDate($createdDate) |
||
776 | { |
||
777 | $this->createdDate = $createdDate; |
||
778 | return $this; |
||
779 | } |
||
780 | |||
781 | /** |
||
782 | * @return null|string |
||
783 | */ |
||
784 | public function getCreditNoteNumber() |
||
785 | { |
||
786 | return $this->creditNoteNumber; |
||
787 | } |
||
788 | |||
789 | /** |
||
790 | * @param null|string $creditNoteNumber |
||
791 | * @return Order |
||
792 | */ |
||
793 | public function setCreditNoteNumber($creditNoteNumber) |
||
794 | { |
||
795 | $this->creditNoteNumber = $creditNoteNumber; |
||
796 | return $this; |
||
797 | } |
||
798 | |||
799 | /** |
||
800 | * @return null|string |
||
801 | */ |
||
802 | public function getCurrencyCode() |
||
803 | { |
||
804 | return $this->currencyCode; |
||
805 | } |
||
806 | |||
807 | /** |
||
808 | * @param null|string $currencyCode |
||
809 | * @return OrderInterface |
||
810 | */ |
||
811 | public function setCurrencyCode($currencyCode) |
||
812 | { |
||
813 | $this->currencyCode = $currencyCode; |
||
814 | return $this; |
||
815 | } |
||
816 | |||
817 | /** |
||
818 | * @return null|string |
||
819 | */ |
||
820 | public function getCustomerComment() |
||
821 | { |
||
822 | return $this->customerComment; |
||
823 | } |
||
824 | |||
825 | /** |
||
826 | * @param null|string $customerComment |
||
827 | * @return OrderInterface |
||
828 | */ |
||
829 | public function setCustomerComment($customerComment) |
||
830 | { |
||
831 | $this->customerComment = $customerComment; |
||
832 | return $this; |
||
833 | } |
||
834 | |||
835 | /** |
||
836 | * @return null|string |
||
837 | */ |
||
838 | public function getGiftCertificateNumber() |
||
839 | { |
||
840 | return $this->giftCertificateNumber; |
||
841 | } |
||
842 | |||
843 | /** |
||
844 | * @param null|string $giftCertificateNumber |
||
845 | * @return OrderInterface |
||
846 | */ |
||
847 | public function setGiftCertificateNumber($giftCertificateNumber) |
||
848 | { |
||
849 | $this->giftCertificateNumber = $giftCertificateNumber; |
||
850 | return $this; |
||
851 | } |
||
852 | |||
853 | /** |
||
854 | * @return bool|null |
||
855 | */ |
||
856 | public function getIncomplete() |
||
857 | { |
||
858 | return $this->incomplete; |
||
859 | } |
||
860 | |||
861 | /** |
||
862 | * @param bool|null $incomplete |
||
863 | * @return OrderInterface |
||
864 | */ |
||
865 | public function setIncomplete($incomplete) |
||
866 | { |
||
867 | $this->incomplete = $incomplete; |
||
868 | return $this; |
||
869 | } |
||
870 | |||
871 | /** |
||
872 | * @return null|string |
||
873 | */ |
||
874 | public function getIp() |
||
875 | { |
||
876 | return $this->ip; |
||
877 | } |
||
878 | |||
879 | /** |
||
880 | * @param null|string $ip |
||
881 | * @return OrderInterface |
||
882 | */ |
||
883 | public function setIp($ip) |
||
884 | { |
||
885 | $this->ip = $ip; |
||
886 | return $this; |
||
887 | } |
||
888 | |||
889 | /** |
||
890 | * @return bool|null |
||
891 | */ |
||
892 | public function getModified() |
||
893 | { |
||
894 | return $this->modified; |
||
895 | } |
||
896 | |||
897 | /** |
||
898 | * @param bool|null $modified |
||
899 | * @return OrderInterface |
||
900 | */ |
||
901 | public function setModified($modified) |
||
902 | { |
||
903 | $this->modified = $modified; |
||
904 | return $this; |
||
905 | } |
||
906 | |||
907 | /** |
||
908 | * @return \DateTimeImmutable|null |
||
909 | */ |
||
910 | public function getModifiedDate() |
||
911 | { |
||
912 | return $this->modifiedDate; |
||
913 | } |
||
914 | |||
915 | /** |
||
916 | * @param \DateTimeImmutable|null $modifiedDate |
||
917 | * @return OrderInterface |
||
918 | */ |
||
919 | public function setModifiedDate($modifiedDate) |
||
923 | } |
||
924 | |||
925 | /** |
||
926 | * @return null|string |
||
927 | */ |
||
928 | public function getReferenceNumber() |
||
929 | { |
||
930 | return $this->referenceNumber; |
||
931 | } |
||
932 | |||
933 | /** |
||
934 | * @param null|string $referenceNumber |
||
935 | * @return OrderInterface |
||
936 | */ |
||
937 | public function setReferenceNumber($referenceNumber) |
||
938 | { |
||
939 | $this->referenceNumber = $referenceNumber; |
||
940 | return $this; |
||
941 | } |
||
942 | |||
943 | /** |
||
944 | * @return null|string |
||
945 | */ |
||
946 | public function getReferrer() |
||
947 | { |
||
948 | return $this->referrer; |
||
949 | } |
||
950 | |||
951 | /** |
||
952 | * @param null|string $referrer |
||
953 | * @return OrderInterface |
||
954 | */ |
||
955 | public function setReferrer($referrer) |
||
956 | { |
||
957 | $this->referrer = $referrer; |
||
958 | return $this; |
||
959 | } |
||
960 | |||
961 | /** |
||
962 | * @return null|string |
||
963 | */ |
||
964 | public function getReservedField1() |
||
965 | { |
||
966 | return $this->reservedField1; |
||
967 | } |
||
968 | |||
969 | /** |
||
970 | * @param null|string $reservedField1 |
||
971 | * @return OrderInterface |
||
972 | */ |
||
973 | public function setReservedField1($reservedField1) |
||
974 | { |
||
975 | $this->reservedField1 = $reservedField1; |
||
976 | return $this; |
||
977 | } |
||
978 | |||
979 | /** |
||
980 | * @return null|string |
||
981 | */ |
||
982 | public function getReservedField2() |
||
983 | { |
||
984 | return $this->reservedField2; |
||
985 | } |
||
986 | |||
987 | /** |
||
988 | * @param null|string $reservedField2 |
||
989 | * @return OrderInterface |
||
990 | */ |
||
991 | public function setReservedField2($reservedField2) |
||
992 | { |
||
993 | $this->reservedField2 = $reservedField2; |
||
994 | return $this; |
||
995 | } |
||
996 | |||
997 | /** |
||
998 | * @return null|string |
||
999 | */ |
||
1000 | public function getReservedField3() |
||
1001 | { |
||
1002 | return $this->reservedField3; |
||
1003 | } |
||
1004 | |||
1005 | /** |
||
1006 | * @param null|string $reservedField3 |
||
1007 | * @return OrderInterface |
||
1008 | */ |
||
1009 | public function setReservedField3($reservedField3) |
||
1010 | { |
||
1011 | $this->reservedField3 = $reservedField3; |
||
1012 | return $this; |
||
1013 | } |
||
1014 | |||
1015 | /** |
||
1016 | * @return null|string |
||
1017 | */ |
||
1018 | public function getReservedField4() |
||
1019 | { |
||
1020 | return $this->reservedField4; |
||
1021 | } |
||
1022 | |||
1023 | /** |
||
1024 | * @param null|string $reservedField4 |
||
1025 | * @return OrderInterface |
||
1026 | */ |
||
1027 | public function setReservedField4($reservedField4) |
||
1028 | { |
||
1029 | $this->reservedField4 = $reservedField4; |
||
1030 | return $this; |
||
1031 | } |
||
1032 | |||
1033 | /** |
||
1034 | * @return null|string |
||
1035 | */ |
||
1036 | public function getReservedField5() |
||
1037 | { |
||
1038 | return $this->reservedField5; |
||
1039 | } |
||
1040 | |||
1041 | /** |
||
1042 | * @param null|string $reservedField5 |
||
1043 | * @return OrderInterface |
||
1044 | */ |
||
1045 | public function setReservedField5($reservedField5) |
||
1046 | { |
||
1047 | $this->reservedField5 = $reservedField5; |
||
1048 | return $this; |
||
1049 | } |
||
1050 | |||
1051 | /** |
||
1052 | * @return float|null |
||
1053 | */ |
||
1054 | public function getTotalWeight() |
||
1055 | { |
||
1056 | return $this->totalWeight; |
||
1057 | } |
||
1058 | |||
1059 | /** |
||
1060 | * @param float|null $totalWeight |
||
1061 | * @return OrderInterface |
||
1062 | */ |
||
1063 | public function setTotalWeight($totalWeight) |
||
1064 | { |
||
1065 | $this->totalWeight = $totalWeight; |
||
1066 | return $this; |
||
1067 | } |
||
1068 | |||
1069 | /** |
||
1070 | * @return null|string |
||
1071 | */ |
||
1072 | public function getTrackingNumber() |
||
1073 | { |
||
1074 | return $this->trackingNumber; |
||
1075 | } |
||
1076 | |||
1077 | /** |
||
1078 | * @param null|string $trackingNumber |
||
1079 | * @return OrderInterface |
||
1080 | */ |
||
1081 | public function setTrackingNumber($trackingNumber) |
||
1082 | { |
||
1083 | $this->trackingNumber = $trackingNumber; |
||
1084 | return $this; |
||
1085 | } |
||
1086 | |||
1087 | /** |
||
1088 | * @return int|null |
||
1089 | */ |
||
1090 | public function getTransactionNumber() |
||
1093 | } |
||
1094 | |||
1095 | /** |
||
1096 | * @param int|null $transactionNumber |
||
1097 | * @return OrderInterface |
||
1098 | */ |
||
1099 | public function setTransactionNumber($transactionNumber) |
||
1100 | { |
||
1101 | $this->transactionNumber = $transactionNumber; |
||
1102 | return $this; |
||
1103 | } |
||
1104 | |||
1105 | /** |
||
1106 | * @return float|null |
||
1107 | */ |
||
1108 | public function getVatPct() |
||
1111 | } |
||
1112 | |||
1113 | /** |
||
1114 | * @param float|null $vatPct |
||
1115 | * @return OrderInterface |
||
1116 | */ |
||
1117 | public function setVatPct($vatPct) |
||
1118 | { |
||
1119 | $this->vatPct = $vatPct; |
||
1120 | return $this; |
||
1121 | } |
||
1122 | |||
1123 | /** |
||
1124 | * @return null|string |
||
1125 | */ |
||
1126 | public function getVatRegNumber() |
||
1127 | { |
||
1128 | return $this->vatRegNumber; |
||
1129 | } |
||
1130 | |||
1131 | /** |
||
1132 | * @param null|string $vatRegNumber |
||
1133 | * @return OrderInterface |
||
1134 | */ |
||
1135 | public function setVatRegNumber($vatRegNumber) |
||
1136 | { |
||
1137 | $this->vatRegNumber = $vatRegNumber; |
||
1138 | return $this; |
||
1139 | } |
||
1140 | |||
1141 | /** |
||
1142 | * @return null|string |
||
1143 | */ |
||
1144 | public function getXmlParams() |
||
1145 | { |
||
1146 | return $this->xmlParams; |
||
1147 | } |
||
1148 | |||
1149 | /** |
||
1150 | * @param null|string $xmlParams |
||
1151 | * @return OrderInterface |
||
1152 | */ |
||
1153 | public function setXmlParams($xmlParams) |
||
1154 | { |
||
1155 | $this->xmlParams = $xmlParams; |
||
1156 | return $this; |
||
1157 | } |
||
1158 | |||
1159 | /** |
||
1160 | * A helper method for creating a Money object from a float based on the shared currency |
||
1161 | * |
||
1162 | * @param int $amount |
||
1163 | * @return Money|null |
||
1164 | */ |
||
1165 | private function createMoney(int $amount = 0) : ?Money |
||
1168 | } |
||
1169 | |||
1170 | /** |
||
1171 | * A helper method for creating a Money object from a float based on the shared currency |
||
1172 | * |
||
1173 | * @param float|string $amount |
||
1174 | * @return Money|null |
||
1175 | */ |
||
1176 | private function createMoneyFromFloat($amount = 0.0) : ?Money |
||
1177 | { |
||
1178 | return DandomainFoundation\createMoneyFromFloat((string)$this->currencyCode, $amount); |
||
1179 | } |
||
1180 | } |
||
1181 |