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