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. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
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 |
||
42 | class Order extends \Eccube\Entity\AbstractEntity implements PurchaseInterface, ItemHolderInterface |
||
43 | { |
||
44 | use NameTrait, PointTrait; |
||
45 | |||
46 | /** |
||
47 | * 課税対象の明細を返す. |
||
48 | 65 | * |
|
49 | * @return array |
||
50 | 65 | */ |
|
51 | public function getTaxableItems() |
||
63 | 65 | ||
64 | /** |
||
65 | * 課税対象の明細の合計金額を返す. |
||
66 | * 商品合計 + 送料 + 手数料 + 値引き(課税). |
||
67 | */ |
||
68 | public function getTaxableTotal() |
||
78 | |||
79 | /** |
||
80 | * 課税対象の明細の合計金額を、税率ごとに集計する. |
||
81 | * |
||
82 | * @return array |
||
83 | */ |
||
84 | public function getTaxableTotalByTaxRate() |
||
100 | 1 | ||
101 | /** |
||
102 | * 課税対象の値引き明細を返す. |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | public function getTaxableDiscountItems() |
||
112 | |||
113 | 1 | /** |
|
114 | 1 | * 課税対象の値引き金額合計を返す. |
|
115 | 1 | * |
|
116 | * @return mixed |
||
117 | */ |
||
118 | 1 | public function getTaxableDiscount() |
|
124 | |||
125 | 1 | /** |
|
126 | 1 | * 非課税・不課税の値引き明細を返す. |
|
127 | 1 | * |
|
128 | 1 | * @return array |
|
129 | 1 | */ |
|
130 | 1 | public function getTaxFreeDiscountItems() |
|
136 | 1 | ||
137 | /** |
||
138 | * 複数配送かどうかの判定を行う. |
||
139 | * |
||
140 | * @return boolean |
||
141 | */ |
||
142 | public function isMultiple() |
||
159 | |||
160 | /** |
||
161 | * 対象となるお届け先情報を取得 |
||
162 | * |
||
163 | * @param integer $shippingId |
||
164 | * |
||
165 | * @return \Eccube\Entity\Shipping|null |
||
166 | */ |
||
167 | public function findShipping($shippingId) |
||
177 | |||
178 | /** |
||
179 | * この注文の保持する販売種別を取得します. |
||
180 | * |
||
181 | * @return \Eccube\Entity\Master\SaleType[] 一意な販売種別の配列 |
||
182 | */ |
||
183 | public function getSaleTypes() |
||
196 | |||
197 | /** |
||
198 | * 同じ規格の商品の個数をまとめた受注明細を取得 |
||
199 | * |
||
200 | * @return OrderItem[] |
||
201 | */ |
||
202 | public function getMergedProductOrderItems() |
||
235 | |||
236 | /** |
||
237 | * 合計金額を計算 |
||
238 | * |
||
239 | * @return string |
||
240 | * |
||
241 | * @deprecated |
||
242 | */ |
||
243 | public function getTotalPrice() |
||
250 | |||
251 | /** |
||
252 | * @var integer |
||
253 | * |
||
254 | * @ORM\Column(name="id", type="integer", options={"unsigned":true}) |
||
255 | * @ORM\Id |
||
256 | * @ORM\GeneratedValue(strategy="IDENTITY") |
||
257 | */ |
||
258 | private $id; |
||
259 | |||
260 | /** |
||
261 | * @var string|null |
||
262 | * |
||
263 | * @ORM\Column(name="pre_order_id", type="string", length=255, nullable=true) |
||
264 | */ |
||
265 | private $pre_order_id; |
||
266 | |||
267 | /** |
||
268 | * @var string|null |
||
269 | * |
||
270 | * @ORM\Column(name="order_no", type="string", length=255, nullable=true) |
||
271 | */ |
||
272 | private $order_no; |
||
273 | |||
274 | /** |
||
275 | * @var string|null |
||
276 | * |
||
277 | * @ORM\Column(name="message", type="string", length=4000, nullable=true) |
||
278 | */ |
||
279 | private $message; |
||
280 | |||
281 | /** |
||
282 | * @var string|null |
||
283 | * |
||
284 | * @ORM\Column(name="name01", type="string", length=255) |
||
285 | */ |
||
286 | private $name01; |
||
287 | |||
288 | /** |
||
289 | * @var string|null |
||
290 | * |
||
291 | * @ORM\Column(name="name02", type="string", length=255) |
||
292 | */ |
||
293 | private $name02; |
||
294 | |||
295 | /** |
||
296 | * @var string|null |
||
297 | * |
||
298 | * @ORM\Column(name="kana01", type="string", length=255, nullable=true) |
||
299 | */ |
||
300 | private $kana01; |
||
301 | |||
302 | /** |
||
303 | * @var string|null |
||
304 | * |
||
305 | * @ORM\Column(name="kana02", type="string", length=255, nullable=true) |
||
306 | */ |
||
307 | private $kana02; |
||
308 | |||
309 | /** |
||
310 | * @var string|null |
||
311 | * |
||
312 | * @ORM\Column(name="company_name", type="string", length=255, nullable=true) |
||
313 | */ |
||
314 | private $company_name; |
||
315 | |||
316 | /** |
||
317 | * @var string|null |
||
318 | * |
||
319 | * @ORM\Column(name="email", type="string", length=255, nullable=true) |
||
320 | */ |
||
321 | private $email; |
||
322 | |||
323 | /** |
||
324 | * @var string|null |
||
325 | * |
||
326 | * @ORM\Column(name="phone_number", type="string", length=14, nullable=true) |
||
327 | */ |
||
328 | private $phone_number; |
||
329 | |||
330 | /** |
||
331 | * @var string|null |
||
332 | * |
||
333 | * @ORM\Column(name="postal_code", type="string", length=8, nullable=true) |
||
334 | */ |
||
335 | private $postal_code; |
||
336 | |||
337 | /** |
||
338 | * @var string|null |
||
339 | * |
||
340 | * @ORM\Column(name="addr01", type="string", length=255, nullable=true) |
||
341 | */ |
||
342 | private $addr01; |
||
343 | |||
344 | /** |
||
345 | * @var string|null |
||
346 | * |
||
347 | * @ORM\Column(name="addr02", type="string", length=255, nullable=true) |
||
348 | */ |
||
349 | private $addr02; |
||
350 | |||
351 | /** |
||
352 | * @var \DateTime|null |
||
353 | * |
||
354 | * @ORM\Column(name="birth", type="datetimetz", nullable=true) |
||
355 | */ |
||
356 | private $birth; |
||
357 | |||
358 | /** |
||
359 | * @var string |
||
360 | * |
||
361 | * @ORM\Column(name="subtotal", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0}) |
||
362 | */ |
||
363 | private $subtotal = 0; |
||
364 | |||
365 | /** |
||
366 | * @var string |
||
367 | * |
||
368 | * @ORM\Column(name="discount", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0}) |
||
369 | */ |
||
370 | private $discount = 0; |
||
371 | |||
372 | /** |
||
373 | * @var string |
||
374 | * |
||
375 | * @ORM\Column(name="delivery_fee_total", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0}) |
||
376 | */ |
||
377 | private $delivery_fee_total = 0; |
||
378 | |||
379 | /** |
||
380 | * @var string |
||
381 | * |
||
382 | * @ORM\Column(name="charge", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0}) |
||
383 | */ |
||
384 | private $charge = 0; |
||
385 | |||
386 | /** |
||
387 | * @var string |
||
388 | * |
||
389 | * @ORM\Column(name="tax", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0}) |
||
390 | * |
||
391 | * @deprecated 明細ごとに集計した税額と差異が発生する場合があるため非推奨 |
||
392 | */ |
||
393 | private $tax = 0; |
||
394 | |||
395 | /** |
||
396 | * @var string |
||
397 | * |
||
398 | * @ORM\Column(name="total", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0}) |
||
399 | */ |
||
400 | private $total = 0; |
||
401 | |||
402 | /** |
||
403 | * @var string |
||
404 | * |
||
405 | * @ORM\Column(name="payment_total", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0}) |
||
406 | */ |
||
407 | private $payment_total = 0; |
||
408 | |||
409 | /** |
||
410 | * @var string|null |
||
411 | * |
||
412 | * @ORM\Column(name="payment_method", type="string", length=255, nullable=true) |
||
413 | */ |
||
414 | private $payment_method; |
||
415 | |||
416 | /** |
||
417 | * @var string|null |
||
418 | * |
||
419 | * @ORM\Column(name="note", type="string", length=4000, nullable=true) |
||
420 | */ |
||
421 | private $note; |
||
422 | |||
423 | /** |
||
424 | * @var \DateTime |
||
425 | * |
||
426 | * @ORM\Column(name="create_date", type="datetimetz") |
||
427 | */ |
||
428 | private $create_date; |
||
429 | |||
430 | /** |
||
431 | * @var \DateTime |
||
432 | * |
||
433 | * @ORM\Column(name="update_date", type="datetimetz") |
||
434 | */ |
||
435 | private $update_date; |
||
436 | |||
437 | /** |
||
438 | * @var \DateTime|null |
||
439 | * |
||
440 | * @ORM\Column(name="order_date", type="datetimetz", nullable=true) |
||
441 | */ |
||
442 | private $order_date; |
||
443 | |||
444 | /** |
||
445 | * @var \DateTime|null |
||
446 | * |
||
447 | * @ORM\Column(name="payment_date", type="datetimetz", nullable=true) |
||
448 | */ |
||
449 | private $payment_date; |
||
450 | |||
451 | /** |
||
452 | * @var string|null |
||
453 | * |
||
454 | * @ORM\Column(name="currency_code", type="string", nullable=true) |
||
455 | */ |
||
456 | private $currency_code; |
||
457 | |||
458 | /** |
||
459 | * 注文完了画面に表示するメッセージ |
||
460 | * |
||
461 | * プラグインから注文完了時にメッセージを表示したい場合, このフィールドにセットすることで, 注文完了画面で表示されます。 |
||
462 | * 複数のプラグインから利用されるため, appendCompleteMesssage()で追加してください. |
||
463 | * 表示する際にHTMLは利用可能です。 |
||
464 | * |
||
465 | * @var string|null |
||
466 | * |
||
467 | * @ORM\Column(name="complete_message", type="text", nullable=true) |
||
468 | */ |
||
469 | private $complete_message; |
||
470 | |||
471 | /** |
||
472 | * 注文完了メールに表示するメッセージ |
||
473 | * |
||
474 | * プラグインから注文完了メールにメッセージを表示したい場合, このフィールドにセットすることで, 注文完了メールで表示されます。 |
||
475 | * 複数のプラグインから利用されるため, appendCompleteMailMesssage()で追加してください. |
||
476 | * |
||
477 | * @var string|null |
||
478 | * |
||
479 | * @ORM\Column(name="complete_mail_message", type="text", nullable=true) |
||
480 | */ |
||
481 | private $complete_mail_message; |
||
482 | |||
483 | /** |
||
484 | * @var \Doctrine\Common\Collections\Collection|OrderItem[] |
||
485 | * |
||
486 | * @ORM\OneToMany(targetEntity="Eccube\Entity\OrderItem", mappedBy="Order", cascade={"persist","remove"}) |
||
487 | */ |
||
488 | private $OrderItems; |
||
489 | |||
490 | /** |
||
491 | * @var \Doctrine\Common\Collections\Collection|Shipping[] |
||
492 | * |
||
493 | * @ORM\OneToMany(targetEntity="Eccube\Entity\Shipping", mappedBy="Order", cascade={"persist","remove"}) |
||
494 | */ |
||
495 | private $Shippings; |
||
496 | |||
497 | /** |
||
498 | * @var \Doctrine\Common\Collections\Collection |
||
499 | * |
||
500 | * @ORM\OneToMany(targetEntity="Eccube\Entity\MailHistory", mappedBy="Order", cascade={"remove"}) |
||
501 | 356 | * @ORM\OrderBy({ |
|
502 | * "send_date"="DESC" |
||
503 | 356 | * }) |
|
504 | 356 | */ |
|
505 | 356 | private $MailHistories; |
|
506 | 356 | ||
507 | 356 | /** |
|
508 | 356 | * @var \Eccube\Entity\Customer |
|
509 | 356 | * |
|
510 | 356 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Customer", inversedBy="Orders") |
|
511 | * @ORM\JoinColumns({ |
||
512 | * @ORM\JoinColumn(name="customer_id", referencedColumnName="id") |
||
513 | 356 | * }) |
|
514 | 356 | */ |
|
515 | 356 | private $Customer; |
|
516 | |||
517 | /** |
||
518 | * @var \Eccube\Entity\Master\Country |
||
519 | * |
||
520 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Country") |
||
521 | 7 | * @ORM\JoinColumns({ |
|
522 | * @ORM\JoinColumn(name="country_id", referencedColumnName="id") |
||
523 | 7 | * }) |
|
524 | 7 | */ |
|
525 | 4 | private $Country; |
|
526 | |||
527 | 7 | /** |
|
528 | * @var \Eccube\Entity\Master\Pref |
||
529 | * |
||
530 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Pref") |
||
531 | * @ORM\JoinColumns({ |
||
532 | * @ORM\JoinColumn(name="pref_id", referencedColumnName="id") |
||
533 | * }) |
||
534 | */ |
||
535 | 124 | private $Pref; |
|
536 | |||
537 | 124 | /** |
|
538 | * @var \Eccube\Entity\Master\Sex |
||
539 | * |
||
540 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Sex") |
||
541 | * @ORM\JoinColumns({ |
||
542 | * @ORM\JoinColumn(name="sex_id", referencedColumnName="id") |
||
543 | * }) |
||
544 | */ |
||
545 | private $Sex; |
||
546 | |||
547 | 205 | /** |
|
548 | * @var \Eccube\Entity\Master\Job |
||
549 | 205 | * |
|
550 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Job") |
||
551 | 205 | * @ORM\JoinColumns({ |
|
552 | * @ORM\JoinColumn(name="job_id", referencedColumnName="id") |
||
553 | * }) |
||
554 | */ |
||
555 | private $Job; |
||
556 | |||
557 | /** |
||
558 | * @var \Eccube\Entity\Payment |
||
559 | 53 | * |
|
560 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Payment") |
||
561 | 53 | * @ORM\JoinColumns({ |
|
562 | * @ORM\JoinColumn(name="payment_id", referencedColumnName="id") |
||
563 | * }) |
||
564 | */ |
||
565 | private $Payment; |
||
566 | |||
567 | /** |
||
568 | * @var \Eccube\Entity\Master\DeviceType |
||
569 | * |
||
570 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\DeviceType") |
||
571 | 227 | * @ORM\JoinColumns({ |
|
572 | * @ORM\JoinColumn(name="device_type_id", referencedColumnName="id") |
||
573 | 227 | * }) |
|
574 | */ |
||
575 | 227 | private $DeviceType; |
|
576 | |||
577 | /** |
||
578 | * OrderStatusより先にプロパティを定義しておかないとセットされなくなる |
||
579 | * |
||
580 | * @var \Eccube\Entity\Master\CustomerOrderStatus |
||
581 | * |
||
582 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\CustomerOrderStatus") |
||
583 | 97 | * @ORM\JoinColumns({ |
|
584 | * @ORM\JoinColumn(name="order_status_id", referencedColumnName="id") |
||
585 | 97 | * }) |
|
586 | */ |
||
587 | private $CustomerOrderStatus; |
||
588 | |||
589 | /** |
||
590 | * OrderStatusより先にプロパティを定義しておかないとセットされなくなる |
||
591 | * |
||
592 | * @var \Eccube\Entity\Master\OrderStatusColor |
||
593 | * |
||
594 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\OrderStatusColor") |
||
595 | 181 | * @ORM\JoinColumns({ |
|
596 | * @ORM\JoinColumn(name="order_status_id", referencedColumnName="id") |
||
597 | 181 | * }) |
|
598 | */ |
||
599 | 181 | private $OrderStatusColor; |
|
600 | |||
601 | /** |
||
602 | * @var \Eccube\Entity\Master\OrderStatus |
||
603 | * |
||
604 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\OrderStatus") |
||
605 | * @ORM\JoinColumns({ |
||
606 | * @ORM\JoinColumn(name="order_status_id", referencedColumnName="id") |
||
607 | 81 | * }) |
|
608 | */ |
||
609 | 81 | private $OrderStatus; |
|
610 | |||
611 | /** |
||
612 | * Constructor |
||
613 | */ |
||
614 | public function __construct(\Eccube\Entity\Master\OrderStatus $orderStatus = null) |
||
630 | |||
631 | 80 | /** |
|
632 | * Clone |
||
633 | 80 | */ |
|
634 | public function __clone() |
||
660 | |||
661 | /** |
||
662 | * Get id. |
||
663 | * |
||
664 | * @return int |
||
665 | */ |
||
666 | public function getId() |
||
670 | |||
671 | 19 | /** |
|
672 | * Set preOrderId. |
||
673 | * |
||
674 | * @param string|null $preOrderId |
||
675 | * |
||
676 | * @return Order |
||
677 | */ |
||
678 | public function setPreOrderId($preOrderId = null) |
||
684 | |||
685 | /** |
||
686 | * Get preOrderId. |
||
687 | * |
||
688 | * @return string|null |
||
689 | */ |
||
690 | public function getPreOrderId() |
||
694 | |||
695 | 19 | /** |
|
696 | * Set orderNo |
||
697 | * |
||
698 | * @param string|null $orderNo |
||
699 | * |
||
700 | * @return Order |
||
701 | */ |
||
702 | public function setOrderNo($orderNo = null) |
||
708 | |||
709 | /** |
||
710 | * Get orderNo |
||
711 | * |
||
712 | * @return string|null |
||
713 | */ |
||
714 | public function getOrderNo() |
||
718 | |||
719 | 16 | /** |
|
720 | * Set message. |
||
721 | * |
||
722 | * @param string|null $message |
||
723 | * |
||
724 | * @return Order |
||
725 | */ |
||
726 | public function setMessage($message = null) |
||
732 | |||
733 | /** |
||
734 | * Get message. |
||
735 | * |
||
736 | * @return string|null |
||
737 | */ |
||
738 | public function getMessage() |
||
742 | |||
743 | 16 | /** |
|
744 | * Set name01. |
||
745 | * |
||
746 | * @param string|null $name01 |
||
747 | * |
||
748 | * @return Order |
||
749 | */ |
||
750 | public function setName01($name01 = null) |
||
756 | |||
757 | /** |
||
758 | * Get name01. |
||
759 | * |
||
760 | * @return string|null |
||
761 | */ |
||
762 | public function getName01() |
||
766 | |||
767 | 17 | /** |
|
768 | * Set name02. |
||
769 | * |
||
770 | * @param string|null $name02 |
||
771 | * |
||
772 | * @return Order |
||
773 | */ |
||
774 | public function setName02($name02 = null) |
||
780 | |||
781 | /** |
||
782 | * Get name02. |
||
783 | * |
||
784 | * @return string|null |
||
785 | */ |
||
786 | public function getName02() |
||
790 | |||
791 | 16 | /** |
|
792 | * Set kana01. |
||
793 | * |
||
794 | * @param string|null $kana01 |
||
795 | * |
||
796 | * @return Order |
||
797 | */ |
||
798 | public function setKana01($kana01 = null) |
||
804 | |||
805 | /** |
||
806 | * Get kana01. |
||
807 | * |
||
808 | * @return string|null |
||
809 | */ |
||
810 | public function getKana01() |
||
814 | |||
815 | 16 | /** |
|
816 | * Set kana02. |
||
817 | * |
||
818 | * @param string|null $kana02 |
||
819 | * |
||
820 | * @return Order |
||
821 | */ |
||
822 | public function setKana02($kana02 = null) |
||
828 | |||
829 | /** |
||
830 | * Get kana02. |
||
831 | * |
||
832 | * @return string|null |
||
833 | */ |
||
834 | public function getKana02() |
||
838 | |||
839 | 16 | /** |
|
840 | * Set companyName. |
||
841 | * |
||
842 | * @param string|null $companyName |
||
843 | * |
||
844 | * @return Order |
||
845 | */ |
||
846 | public function setCompanyName($companyName = null) |
||
852 | |||
853 | /** |
||
854 | * Get companyName. |
||
855 | * |
||
856 | * @return string|null |
||
857 | */ |
||
858 | public function getCompanyName() |
||
862 | |||
863 | 5 | /** |
|
864 | * Set email. |
||
865 | * |
||
866 | * @param string|null $email |
||
867 | * |
||
868 | * @return Order |
||
869 | */ |
||
870 | public function setEmail($email = null) |
||
876 | |||
877 | /** |
||
878 | * Get email. |
||
879 | * |
||
880 | * @return string|null |
||
881 | */ |
||
882 | public function getEmail() |
||
886 | |||
887 | 356 | /** |
|
888 | * Set phone_number. |
||
889 | * |
||
890 | * @param string|null $phone_number |
||
891 | * |
||
892 | * @return Order |
||
893 | */ |
||
894 | public function setPhoneNumber($phone_number = null) |
||
900 | |||
901 | /** |
||
902 | * Get phone_number. |
||
903 | * |
||
904 | * @return string|null |
||
905 | */ |
||
906 | public function getPhoneNumber() |
||
910 | |||
911 | 356 | /** |
|
912 | * Set postal_code. |
||
913 | * |
||
914 | * @param string|null $postal_code |
||
915 | * |
||
916 | * @return Order |
||
917 | */ |
||
918 | public function setPostalCode($postal_code = null) |
||
924 | |||
925 | /** |
||
926 | * Get postal_code. |
||
927 | * |
||
928 | * @return string|null |
||
929 | */ |
||
930 | public function getPostalCode() |
||
934 | |||
935 | 356 | /** |
|
936 | * Set addr01. |
||
937 | * |
||
938 | * @param string|null $addr01 |
||
939 | * |
||
940 | * @return Order |
||
941 | */ |
||
942 | public function setAddr01($addr01 = null) |
||
948 | |||
949 | /** |
||
950 | * Get addr01. |
||
951 | * |
||
952 | * @return string|null |
||
953 | */ |
||
954 | public function getAddr01() |
||
958 | |||
959 | 356 | /** |
|
960 | * Set addr02. |
||
961 | * |
||
962 | * @param string|null $addr02 |
||
963 | * |
||
964 | * @return Order |
||
965 | */ |
||
966 | public function setAddr02($addr02 = null) |
||
972 | |||
973 | /** |
||
974 | * Get addr02. |
||
975 | * |
||
976 | * @return string|null |
||
977 | */ |
||
978 | public function getAddr02() |
||
982 | |||
983 | 356 | /** |
|
984 | * Set birth. |
||
985 | * |
||
986 | * @param \DateTime|null $birth |
||
987 | * |
||
988 | * @return Order |
||
989 | */ |
||
990 | public function setBirth($birth = null) |
||
996 | |||
997 | /** |
||
998 | * Get birth. |
||
999 | * |
||
1000 | * @return \DateTime|null |
||
1001 | */ |
||
1002 | public function getBirth() |
||
1006 | |||
1007 | 356 | /** |
|
1008 | * Set subtotal. |
||
1009 | * |
||
1010 | * @param string $subtotal |
||
1011 | * |
||
1012 | * @return Order |
||
1013 | */ |
||
1014 | public function setSubtotal($subtotal) |
||
1020 | |||
1021 | /** |
||
1022 | * Get subtotal. |
||
1023 | * |
||
1024 | * @return string |
||
1025 | */ |
||
1026 | public function getSubtotal() |
||
1030 | |||
1031 | 356 | /** |
|
1032 | * Set discount. |
||
1033 | * |
||
1034 | * @param string $discount |
||
1035 | * |
||
1036 | * @return Order |
||
1037 | */ |
||
1038 | public function setDiscount($discount) |
||
1044 | |||
1045 | /** |
||
1046 | * Get discount. |
||
1047 | * |
||
1048 | * @deprecated 4.0.3 から値引きは課税値引きと 非課税・不課税の値引きの2種に分かれる. 課税値引きについてはgetTaxableDiscountを利用してください. |
||
1049 | * @return string |
||
1050 | */ |
||
1051 | 218 | public function getDiscount() |
|
1055 | 218 | ||
1056 | /** |
||
1057 | * Set deliveryFeeTotal. |
||
1058 | * |
||
1059 | * @param string $deliveryFeeTotal |
||
1060 | * |
||
1061 | * @return Order |
||
1062 | */ |
||
1063 | 20 | public function setDeliveryFeeTotal($deliveryFeeTotal) |
|
1069 | |||
1070 | /** |
||
1071 | * Get deliveryFeeTotal. |
||
1072 | * |
||
1073 | * @return string |
||
1074 | */ |
||
1075 | 156 | public function getDeliveryFeeTotal() |
|
1079 | 156 | ||
1080 | /** |
||
1081 | * Set charge. |
||
1082 | * |
||
1083 | * @param string $charge |
||
1084 | * |
||
1085 | * @return Order |
||
1086 | */ |
||
1087 | 20 | public function setCharge($charge) |
|
1093 | |||
1094 | /** |
||
1095 | * Get charge. |
||
1096 | * |
||
1097 | * @return string |
||
1098 | */ |
||
1099 | 207 | public function getCharge() |
|
1103 | 207 | ||
1104 | /** |
||
1105 | * Set tax. |
||
1106 | * |
||
1107 | * @param string $tax |
||
1108 | * |
||
1109 | * @return Order |
||
1110 | * |
||
1111 | 3 | * @deprecated 明細ごとに集計した税額と差異が発生する場合があるため非推奨 |
|
1112 | */ |
||
1113 | 3 | public function setTax($tax) |
|
1119 | |||
1120 | /** |
||
1121 | * Get tax. |
||
1122 | * |
||
1123 | 207 | * @return string |
|
1124 | * |
||
1125 | 207 | * @deprecated 明細ごとに集計した税額と差異が発生する場合があるため非推奨 |
|
1126 | */ |
||
1127 | 207 | public function getTax() |
|
1131 | |||
1132 | /** |
||
1133 | * Set total. |
||
1134 | * |
||
1135 | 2 | * @param string $total |
|
1136 | * |
||
1137 | 2 | * @return Order |
|
1138 | */ |
||
1139 | public function setTotal($total) |
||
1145 | |||
1146 | /** |
||
1147 | 47 | * Get total. |
|
1148 | * |
||
1149 | 47 | * @return string |
|
1150 | */ |
||
1151 | 47 | public function getTotal() |
|
1155 | |||
1156 | /** |
||
1157 | * Set paymentTotal. |
||
1158 | * |
||
1159 | 33 | * @param string $paymentTotal |
|
1160 | * |
||
1161 | 33 | * @return Order |
|
1162 | */ |
||
1163 | public function setPaymentTotal($paymentTotal) |
||
1169 | |||
1170 | /** |
||
1171 | 4 | * Get paymentTotal. |
|
1172 | * |
||
1173 | 4 | * @return string |
|
1174 | */ |
||
1175 | 4 | public function getPaymentTotal() |
|
1179 | |||
1180 | /** |
||
1181 | * Set paymentMethod. |
||
1182 | * |
||
1183 | 15 | * @param string|null $paymentMethod |
|
1184 | * |
||
1185 | 15 | * @return Order |
|
1186 | */ |
||
1187 | public function setPaymentMethod($paymentMethod = null) |
||
1193 | |||
1194 | /** |
||
1195 | * Get paymentMethod. |
||
1196 | * |
||
1197 | * @return string|null |
||
1198 | */ |
||
1199 | public function getPaymentMethod() |
||
1203 | |||
1204 | /** |
||
1205 | 207 | * Set note. |
|
1206 | * |
||
1207 | 207 | * @param string|null $note |
|
1208 | * |
||
1209 | 207 | * @return Order |
|
1210 | */ |
||
1211 | public function setNote($note = null) |
||
1217 | 1 | ||
1218 | /** |
||
1219 | * Get note. |
||
1220 | * |
||
1221 | * @return string|null |
||
1222 | */ |
||
1223 | public function getNote() |
||
1227 | |||
1228 | /** |
||
1229 | * Set createDate. |
||
1230 | * |
||
1231 | * @param \DateTime $createDate |
||
1232 | * |
||
1233 | * @return Order |
||
1234 | */ |
||
1235 | public function setCreateDate($createDate) |
||
1241 | |||
1242 | /** |
||
1243 | * Get createDate. |
||
1244 | * |
||
1245 | * @return \DateTime |
||
1246 | */ |
||
1247 | 11 | public function getCreateDate() |
|
1251 | |||
1252 | /** |
||
1253 | * Set updateDate. |
||
1254 | * |
||
1255 | * @param \DateTime $updateDate |
||
1256 | * |
||
1257 | * @return Order |
||
1258 | */ |
||
1259 | public function setUpdateDate($updateDate) |
||
1265 | |||
1266 | /** |
||
1267 | * Get updateDate. |
||
1268 | * |
||
1269 | * @return \DateTime |
||
1270 | */ |
||
1271 | public function getUpdateDate() |
||
1275 | |||
1276 | /** |
||
1277 | * Set orderDate. |
||
1278 | * |
||
1279 | * @param \DateTime|null $orderDate |
||
1280 | * |
||
1281 | 36 | * @return Order |
|
1282 | */ |
||
1283 | 36 | public function setOrderDate($orderDate = null) |
|
1289 | |||
1290 | /** |
||
1291 | * Get orderDate. |
||
1292 | * |
||
1293 | * @return \DateTime|null |
||
1294 | */ |
||
1295 | 282 | public function getOrderDate() |
|
1299 | 282 | ||
1300 | /** |
||
1301 | * Set paymentDate. |
||
1302 | * |
||
1303 | * @param \DateTime|null $paymentDate |
||
1304 | * |
||
1305 | * @return Order |
||
1306 | */ |
||
1307 | public function setPaymentDate($paymentDate = null) |
||
1313 | |||
1314 | /** |
||
1315 | * Get paymentDate. |
||
1316 | * |
||
1317 | * @return \DateTime|null |
||
1318 | */ |
||
1319 | 284 | public function getPaymentDate() |
|
1323 | |||
1324 | /** |
||
1325 | * Get currencyCode. |
||
1326 | * |
||
1327 | * @return string |
||
1328 | */ |
||
1329 | 273 | public function getCurrencyCode() |
|
1333 | |||
1334 | /** |
||
1335 | * Set currencyCode. |
||
1336 | * |
||
1337 | * @param string|null $currencyCode |
||
1338 | * |
||
1339 | * @return $this |
||
1340 | */ |
||
1341 | 218 | public function setCurrencyCode($currencyCode = null) |
|
1347 | |||
1348 | /** |
||
1349 | * @return null|string |
||
1350 | */ |
||
1351 | public function getCompleteMessage() |
||
1355 | 25 | ||
1356 | /** |
||
1357 | 25 | * @param null|string $complete_message |
|
1358 | * |
||
1359 | * @return $this |
||
1360 | */ |
||
1361 | public function setCompleteMessage($complete_message = null) |
||
1367 | 115 | ||
1368 | 115 | /** |
|
1369 | * @param null|string $complete_message |
||
1370 | 115 | * |
|
1371 | * @return $this |
||
1372 | */ |
||
1373 | public function appendCompleteMessage($complete_message = null) |
||
1379 | |||
1380 | /** |
||
1381 | * @return null|string |
||
1382 | */ |
||
1383 | public function getCompleteMailMessage() |
||
1387 | |||
1388 | /** |
||
1389 | * @param null|string $complete_mail_message |
||
1390 | * |
||
1391 | * @return |
||
1392 | */ |
||
1393 | public function setCompleteMailMessage($complete_mail_message = null) |
||
1399 | |||
1400 | /** |
||
1401 | * @param null|string $complete_mail_message |
||
1402 | * |
||
1403 | * @return |
||
1404 | 1 | */ |
|
1405 | public function appendCompleteMailMessage($complete_mail_message = null) |
||
1411 | |||
1412 | /** |
||
1413 | * 商品の受注明細を取得 |
||
1414 | * |
||
1415 | * @return OrderItem[] |
||
1416 | 246 | */ |
|
1417 | public function getProductOrderItems() |
||
1423 | |||
1424 | /** |
||
1425 | * Add orderItem. |
||
1426 | * |
||
1427 | * @param \Eccube\Entity\OrderItem $OrderItem |
||
1428 | 273 | * |
|
1429 | * @return Order |
||
1430 | 273 | */ |
|
1431 | public function addOrderItem(\Eccube\Entity\OrderItem $OrderItem) |
||
1437 | |||
1438 | /** |
||
1439 | * Remove orderItem. |
||
1440 | * |
||
1441 | * @param \Eccube\Entity\OrderItem $OrderItem |
||
1442 | * |
||
1443 | * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. |
||
1444 | */ |
||
1445 | public function removeOrderItem(\Eccube\Entity\OrderItem $OrderItem) |
||
1449 | |||
1450 | /** |
||
1451 | * Get orderItems. |
||
1452 | * |
||
1453 | * @return \Doctrine\Common\Collections\Collection|OrderItem[] |
||
1454 | */ |
||
1455 | public function getOrderItems() |
||
1459 | |||
1460 | /** |
||
1461 | * Sorted to getOrderItems() |
||
1462 | * |
||
1463 | * @return ItemCollection |
||
1464 | 167 | */ |
|
1465 | public function getItems() |
||
1469 | |||
1470 | /** |
||
1471 | * Add shipping. |
||
1472 | * |
||
1473 | * @param \Eccube\Entity\Shipping $Shipping |
||
1474 | * |
||
1475 | * @return Order |
||
1476 | 73 | */ |
|
1477 | public function addShipping(\Eccube\Entity\Shipping $Shipping) |
||
1483 | |||
1484 | /** |
||
1485 | * Remove shipping. |
||
1486 | * |
||
1487 | * @param \Eccube\Entity\Shipping $Shipping |
||
1488 | 6 | * |
|
1489 | * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. |
||
1490 | 6 | */ |
|
1491 | public function removeShipping(\Eccube\Entity\Shipping $Shipping) |
||
1495 | |||
1496 | /** |
||
1497 | * Get shippings. |
||
1498 | * |
||
1499 | * @return \Doctrine\Common\Collections\Collection|\Eccube\Entity\Shipping[] |
||
1500 | 3 | */ |
|
1501 | public function getShippings() |
||
1508 | |||
1509 | /** |
||
1510 | * Add mailHistory. |
||
1511 | * |
||
1512 | 5 | * @param \Eccube\Entity\MailHistory $mailHistory |
|
1513 | * |
||
1514 | 5 | * @return Order |
|
1515 | */ |
||
1516 | 5 | public function addMailHistory(\Eccube\Entity\MailHistory $mailHistory) |
|
1522 | |||
1523 | /** |
||
1524 | 3 | * Remove mailHistory. |
|
1525 | * |
||
1526 | 3 | * @param \Eccube\Entity\MailHistory $mailHistory |
|
1527 | * |
||
1528 | * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. |
||
1529 | */ |
||
1530 | public function removeMailHistory(\Eccube\Entity\MailHistory $mailHistory) |
||
1534 | |||
1535 | /** |
||
1536 | 218 | * Get mailHistories. |
|
1537 | * |
||
1538 | 218 | * @return \Doctrine\Common\Collections\Collection |
|
1539 | */ |
||
1540 | 218 | public function getMailHistories() |
|
1544 | |||
1545 | /** |
||
1546 | * Set customer. |
||
1547 | * |
||
1548 | 218 | * @param \Eccube\Entity\Customer|null $customer |
|
1549 | * |
||
1550 | 218 | * @return Order |
|
1551 | */ |
||
1552 | public function setCustomer(\Eccube\Entity\Customer $customer = null) |
||
1558 | |||
1559 | /** |
||
1560 | 51 | * Get customer. |
|
1561 | * |
||
1562 | 51 | * @return \Eccube\Entity\Customer|null |
|
1563 | */ |
||
1564 | 51 | public function getCustomer() |
|
1568 | |||
1569 | /** |
||
1570 | * Set country. |
||
1571 | * |
||
1572 | 2 | * @param \Eccube\Entity\Master\Country|null $country |
|
1573 | * |
||
1574 | 2 | * @return Order |
|
1575 | */ |
||
1576 | public function setCountry(\Eccube\Entity\Master\Country $country = null) |
||
1582 | |||
1583 | /** |
||
1584 | * Get country. |
||
1585 | * |
||
1586 | * @return \Eccube\Entity\Master\Country|null |
||
1587 | */ |
||
1588 | public function getCountry() |
||
1592 | |||
1593 | /** |
||
1594 | * Set pref. |
||
1595 | * |
||
1596 | * @param \Eccube\Entity\Master\Pref|null $pref |
||
1597 | * |
||
1598 | * @return Order |
||
1599 | */ |
||
1600 | public function setPref(\Eccube\Entity\Master\Pref $pref = null) |
||
1606 | |||
1607 | /** |
||
1608 | 356 | * Get pref. |
|
1609 | * |
||
1610 | 356 | * @return \Eccube\Entity\Master\Pref|null |
|
1611 | */ |
||
1612 | 356 | public function getPref() |
|
1616 | |||
1617 | /** |
||
1618 | * Set sex. |
||
1619 | * |
||
1620 | 237 | * @param \Eccube\Entity\Master\Sex|null $sex |
|
1621 | * |
||
1622 | 237 | * @return Order |
|
1623 | */ |
||
1624 | public function setSex(\Eccube\Entity\Master\Sex $sex = null) |
||
1630 | 72 | ||
1631 | /** |
||
1632 | * Get sex. |
||
1633 | 1 | * |
|
1634 | * @return \Eccube\Entity\Master\Sex|null |
||
1635 | 1 | */ |
|
1636 | 1 | public function getSex() |
|
1640 | 1 | ||
1641 | /** |
||
1642 | * Set job. |
||
1643 | * |
||
1644 | * @param \Eccube\Entity\Master\Job|null $job |
||
1645 | * |
||
1646 | * @return Order |
||
1647 | */ |
||
1648 | public function setJob(\Eccube\Entity\Master\Job $job = null) |
||
1654 | |||
1655 | /** |
||
1656 | * Get job. |
||
1657 | * |
||
1658 | * @return \Eccube\Entity\Master\Job|null |
||
1659 | */ |
||
1660 | public function getJob() |
||
1664 | |||
1665 | /** |
||
1666 | * Set payment. |
||
1667 | * |
||
1668 | * @param \Eccube\Entity\Payment|null $payment |
||
1669 | * |
||
1670 | * @return Order |
||
1671 | */ |
||
1672 | public function setPayment(\Eccube\Entity\Payment $payment = null) |
||
1678 | |||
1679 | /** |
||
1680 | * Get payment. |
||
1681 | * |
||
1682 | * @return \Eccube\Entity\Payment|null |
||
1683 | */ |
||
1684 | public function getPayment() |
||
1688 | |||
1689 | /** |
||
1690 | * Set deviceType. |
||
1691 | * |
||
1692 | * @param \Eccube\Entity\Master\DeviceType|null $deviceType |
||
1693 | * |
||
1694 | * @return Order |
||
1695 | */ |
||
1696 | public function setDeviceType(\Eccube\Entity\Master\DeviceType $deviceType = null) |
||
1702 | |||
1703 | /** |
||
1704 | * Get deviceType. |
||
1705 | * |
||
1706 | * @return \Eccube\Entity\Master\DeviceType|null |
||
1707 | */ |
||
1708 | public function getDeviceType() |
||
1712 | |||
1713 | /** |
||
1714 | * Set customerOrderStatus. |
||
1715 | * |
||
1716 | * @param \Eccube\Entity\Master\CustomerOrderStatus|null $customerOrderStatus |
||
1717 | * |
||
1718 | * @return Order |
||
1719 | */ |
||
1720 | public function setCustomerOrderStatus(\Eccube\Entity\Master\CustomerOrderStatus $customerOrderStatus = null) |
||
1726 | |||
1727 | /** |
||
1728 | * Get customerOrderStatus. |
||
1729 | * |
||
1730 | * @return \Eccube\Entity\Master\CustomerOrderStatus|null |
||
1731 | */ |
||
1732 | public function getCustomerOrderStatus() |
||
1736 | |||
1737 | /** |
||
1738 | * Set orderStatusColor. |
||
1739 | * |
||
1740 | * @param \Eccube\Entity\Master\OrderStatusColor|null $orderStatusColor |
||
1741 | * |
||
1742 | * @return Order |
||
1743 | */ |
||
1744 | public function setOrderStatusColor(\Eccube\Entity\Master\OrderStatusColor $orderStatusColor = null) |
||
1750 | |||
1751 | /** |
||
1752 | * Get orderStatusColor. |
||
1753 | * |
||
1754 | * @return \Eccube\Entity\Master\OrderStatusColor|null |
||
1755 | */ |
||
1756 | public function getOrderStatusColor() |
||
1760 | |||
1761 | /** |
||
1762 | * Set orderStatus. |
||
1763 | * |
||
1764 | * @param \Eccube\Entity\Master\OrderStatus|null|object $orderStatus |
||
1765 | * |
||
1766 | * @return Order |
||
1767 | */ |
||
1768 | public function setOrderStatus(\Eccube\Entity\Master\OrderStatus $orderStatus = null) |
||
1774 | |||
1775 | /** |
||
1776 | * Get orderStatus. |
||
1777 | * |
||
1778 | * @return \Eccube\Entity\Master\OrderStatus|null |
||
1779 | */ |
||
1780 | public function getOrderStatus() |
||
1784 | |||
1785 | /** |
||
1786 | * @param ItemInterface $item |
||
1787 | */ |
||
1788 | public function addItem(ItemInterface $item) |
||
1792 | |||
1793 | public function getQuantity() |
||
1802 | } |
||
1803 | } |
||
1804 |
If you suppress an error, we recommend checking for the error condition explicitly: