Failed Conditions
Pull Request — experimental/sf (#31)
by Kentaro
06:59
created

Shipping   F

Complexity

Total Complexity 66

Size/Duplication

Total Lines 1032
Duplicated Lines 1.55 %

Coupling/Cohesion

Components 3
Dependencies 7

Importance

Changes 0
Metric Value
dl 16
loc 1032
rs 2.592
c 0
b 0
f 0
wmc 66
lcom 3
cbo 7

66 Methods

Rating   Name   Duplication   Size   Complexity  
A getShippingMultipleDefaultName() 0 4 1
A __construct() 0 4 1
A setFromCustomerAddress() 16 16 1
A clearCustomerAddress() 0 16 1
A getId() 0 4 1
A setName01() 0 6 1
A getName01() 0 4 1
A setName02() 0 6 1
A getName02() 0 4 1
A setKana01() 0 6 1
A getKana01() 0 4 1
A setKana02() 0 6 1
A getKana02() 0 4 1
A setCompanyName() 0 6 1
A getCompanyName() 0 4 1
A setPhoneNumber() 0 6 1
A getPhoneNumber() 0 4 1
A setPostalCode() 0 6 1
A getPostalCode() 0 4 1
A setAddr01() 0 6 1
A getAddr01() 0 4 1
A setAddr02() 0 6 1
A getAddr02() 0 4 1
A setShippingDeliveryName() 0 6 1
A getShippingDeliveryName() 0 4 1
A setShippingDeliveryTime() 0 6 1
A getShippingDeliveryTime() 0 4 1
A setShippingDeliveryDate() 0 6 1
A getShippingDeliveryDate() 0 4 1
A setShippingDeliveryFee() 0 6 1
A getShippingDeliveryFee() 0 4 1
A setShippingDate() 0 6 1
A getShippingDate() 0 4 1
A setSortNo() 0 6 1
A getSortNo() 0 4 1
A setCreateDate() 0 6 1
A getCreateDate() 0 4 1
A setUpdateDate() 0 6 1
A getUpdateDate() 0 4 1
A setMailSendDate() 0 6 1
A getMailSendDate() 0 4 1
A addOrderItem() 0 6 1
A removeOrderItem() 0 4 1
A getOrderItems() 0 4 1
A getProductOrderItems() 0 6 1
A setCountry() 0 6 1
A getCountry() 0 4 1
A setPref() 0 6 1
A getPref() 0 4 1
A setDelivery() 0 6 1
A getDelivery() 0 4 1
A getProductClassOfTemp() 0 4 1
A setProductClassOfTemp() 0 6 1
A setOrder() 0 6 1
A getOrder() 0 4 1
A setTrackingNumber() 0 6 1
A getTrackingNumber() 0 4 1
A setNote() 0 6 1
A getNote() 0 4 1
A isShipped() 0 4 1
A setTimeId() 0 6 1
A getTimeId() 0 4 1
A setFeeId() 0 6 1
A getFeeId() 0 4 1
A setCreator() 0 6 1
A getCreator() 0 4 1

How to fix   Duplicated Code    Complexity   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

Complex Class

 Tip:   Before tackling complexity, make sure that you eliminate any duplication first. This often can reduce the size of classes significantly.

Complex classes like Shipping 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 Shipping, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.lockon.co.jp/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Eccube\Entity;
15
16
use Doctrine\ORM\Mapping as ORM;
17
use Eccube\Service\Calculator\OrderItemCollection;
18
use Eccube\Service\PurchaseFlow\ItemCollection;
19
20
if (!class_exists('\Eccube\Entity\Shipping')) {
21
    /**
22
     * Shipping
23
     *
24
     * @ORM\Table(name="dtb_shipping")
25
     * @ORM\InheritanceType("SINGLE_TABLE")
26
     * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
27
     * @ORM\HasLifecycleCallbacks()
28
     * @ORM\Entity(repositoryClass="Eccube\Repository\ShippingRepository")
29
     */
30
    class Shipping extends \Eccube\Entity\AbstractEntity
31
    {
32
        use NameTrait;
33
34
        public function getShippingMultipleDefaultName()
35
        {
36
            return $this->getName01().' '.$this->getPref()->getName().' '.$this->getAddr01().' '.$this->getAddr02();
37
        }
38
39
        /**
40
         * @var int
41
         *
42
         * @ORM\Column(name="id", type="integer", options={"unsigned":true})
43
         * @ORM\Id
44
         * @ORM\GeneratedValue(strategy="IDENTITY")
45
         */
46
        private $id;
47
48
        /**
49
         * @var string
50
         *
51
         * @ORM\Column(name="name01", type="string", length=255)
52
         */
53
        private $name01;
54
55
        /**
56
         * @var string
57
         *
58
         * @ORM\Column(name="name02", type="string", length=255)
59
         */
60
        private $name02;
61
62
        /**
63
         * @var string
64
         *
65
         * @ORM\Column(name="kana01", type="string", length=255)
66
         */
67
        private $kana01;
68
69
        /**
70
         * @var string
71
         *
72
         * @ORM\Column(name="kana02", type="string", length=255)
73
         */
74
        private $kana02;
75
76
        /**
77
         * @var string|null
78
         *
79
         * @ORM\Column(name="company_name", type="string", length=255, nullable=true)
80
         */
81
        private $company_name;
82
83
        /**
84
         * @var string|null
85
         *
86
         * @ORM\Column(name="phone_number", type="string", length=14, nullable=true)
87
         */
88
        private $phone_number;
89
90
        /**
91
         * @var string|null
92
         *
93
         * @ORM\Column(name="postal_code", type="string", length=8, nullable=true)
94
         */
95
        private $postal_code;
96
97
        /**
98
         * @var string|null
99
         *
100
         * @ORM\Column(name="addr01", type="string", length=255, nullable=true)
101
         */
102
        private $addr01;
103
104
        /**
105
         * @var string|null
106
         *
107
         * @ORM\Column(name="addr02", type="string", length=255, nullable=true)
108
         */
109
        private $addr02;
110
111
        /**
112
         * @var string|null
113
         *
114
         * @ORM\Column(name="delivery_name", type="string", length=255, nullable=true)
115
         */
116
        private $shipping_delivery_name;
117
118
        /**
119
         * @var int
120
         *
121
         * @ORM\Column(name="time_id", type="integer", options={"unsigned":true}, nullable=true)
122
         */
123
        private $time_id;
124
125
        /**
126
         * @var int
127
         *
128
         * @ORM\Column(name="fee_id", type="integer", options={"unsigned":true}, nullable=true)
129
         */
130
        private $fee_id;
131
132
        /**
133
         * @var string|null
134
         *
135
         * @ORM\Column(name="delivery_time", type="string", length=255, nullable=true)
136
         */
137
        private $shipping_delivery_time;
138
139
        /**
140
         * お届け予定日/お届け希望日
141
         *
142
         * @var \DateTime|null
143
         *
144
         * @ORM\Column(name="delivery_date", type="datetimetz", nullable=true)
145
         */
146
        private $shipping_delivery_date;
147
148
        /**
149
         * @var string|null
150
         *
151
         * @ORM\Column(name="delivery_fee", type="decimal", precision=12, scale=2, nullable=true, options={"unsigned":true,"default":0})
152
         */
153
        private $shipping_delivery_fee = 0;
154
155
        /**
156
         * 出荷日
157
         *
158
         * @var \DateTime|null
159
         *
160
         * @ORM\Column(name="shipping_date", type="datetimetz", nullable=true)
161
         */
162
        private $shipping_date;
163
164
        /**
165
         * @var string
166
         *
167
         * @ORM\Column(name="tracking_number", type="string", length=255, nullable=true)
168
         */
169
        private $tracking_number;
170
171
        /**
172
         * @var string
173
         *
174
         * @ORM\Column(name="note", type="string", length=4000, nullable=true)
175
         */
176
        private $note;
177
178
        /**
179
         * @var int|null
180
         *
181
         * @ORM\Column(name="sort_no", type="smallint", nullable=true, options={"unsigned":true})
182
         */
183
        private $sort_no;
184
185
        /**
186
         * @var \DateTime
187
         *
188
         * @ORM\Column(name="create_date", type="datetimetz")
189
         */
190
        private $create_date;
191
192
        /**
193
         * @var \DateTime
194
         *
195
         * @ORM\Column(name="update_date", type="datetimetz")
196
         */
197
        private $update_date;
198
199
        /**
200
         * @var \DateTime
201
         *
202
         * @ORM\Column(name="mail_send_date", type="datetimetz", nullable=true)
203
         */
204
        private $mail_send_date;
205
206
        /**
207
         * @var \Eccube\Entity\Order
208
         *
209
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Order", inversedBy="Shippings", cascade={"persist"})
210
         * @ORM\JoinColumns({
211
         *   @ORM\JoinColumn(name="order_id", referencedColumnName="id")
212
         * })
213
         */
214
        private $Order;
215
216
        /**
217
         * @var \Doctrine\Common\Collections\Collection
218
         *
219
         * @ORM\OneToMany(targetEntity="Eccube\Entity\OrderItem", mappedBy="Shipping", cascade={"persist"})
220
         */
221
        private $OrderItems;
222
223
        /**
224
         * @var \Eccube\Entity\Master\Country
225
         *
226
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Country")
227
         * @ORM\JoinColumns({
228
         *   @ORM\JoinColumn(name="country_id", referencedColumnName="id")
229
         * })
230
         */
231
        private $Country;
232
233
        /**
234
         * @var \Eccube\Entity\Master\Pref
235
         *
236
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Pref")
237
         * @ORM\JoinColumns({
238
         *   @ORM\JoinColumn(name="pref_id", referencedColumnName="id")
239
         * })
240
         */
241
        private $Pref;
242
243
        /**
244
         * @var \Eccube\Entity\Delivery
245
         *
246
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Delivery")
247
         * @ORM\JoinColumns({
248
         *   @ORM\JoinColumn(name="delivery_id", referencedColumnName="id")
249
         * })
250
         */
251
        private $Delivery;
252
253
        /**
254
         * @var \Eccube\Entity\ProductClass
255
         */
256
        private $ProductClassOfTemp;
257
258
        /**
259
         * @var \Eccube\Entity\Member
260
         *
261
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member")
262
         * @ORM\JoinColumns({
263
         *   @ORM\JoinColumn(name="creator_id", referencedColumnName="id")
264
         * })
265
         */
266
        private $Creator;
267
268
        /**
269
         * Constructor
270
         */
271
        public function __construct()
272
        {
273
            $this->OrderItems = new \Doctrine\Common\Collections\ArrayCollection();
274
        }
275
276
        /**
277
         * CustomerAddress から個人情報を設定.
278
         *
279
         * @param \Eccube\Entity\CustomerAddress $CustomerAddress
280
         *
281
         * @return \Eccube\Entity\Shipping
282
         */
283 View Code Duplication
        public function setFromCustomerAddress(CustomerAddress $CustomerAddress)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
284
        {
285
            $this
286
            ->setName01($CustomerAddress->getName01())
287
            ->setName02($CustomerAddress->getName02())
288
            ->setKana01($CustomerAddress->getKana01())
289
            ->setKana02($CustomerAddress->getKana02())
290
            ->setCompanyName($CustomerAddress->getCompanyName())
291
            ->setPhoneNumber($CustomerAddress->getPhonenumber())
292
            ->setPostalCode($CustomerAddress->getPostalCode())
293
            ->setPref($CustomerAddress->getPref())
294
            ->setAddr01($CustomerAddress->getAddr01())
295
            ->setAddr02($CustomerAddress->getAddr02());
296
297
            return $this;
298
        }
299
300
        /**
301
         * 個人情報をクリア.
302
         *
303
         * @return \Eccube\Entity\Shipping
304
         */
305
        public function clearCustomerAddress()
306
        {
307
            $this
308
            ->setName01(null)
309
            ->setName02(null)
310
            ->setKana01(null)
311
            ->setKana02(null)
312
            ->setCompanyName(null)
313
            ->setPhoneNumber(null)
314
            ->setPostalCode(null)
315
            ->setPref(null)
316
            ->setAddr01(null)
317
            ->setAddr02(null);
318
319
            return $this;
320
        }
321
322
        /**
323
         * Get id.
324
         *
325
         * @return int
326
         */
327
        public function getId()
328
        {
329
            return $this->id;
330
        }
331
332
        /**
333
         * Set name01.
334
         *
335
         * @param string $name01
336
         *
337
         * @return Shipping
338
         */
339
        public function setName01($name01)
340
        {
341
            $this->name01 = $name01;
342
343
            return $this;
344
        }
345
346
        /**
347
         * Get name01.
348
         *
349
         * @return string
350
         */
351
        public function getName01()
352
        {
353
            return $this->name01;
354
        }
355
356
        /**
357
         * Set name02.
358
         *
359
         * @param string $name02
360
         *
361
         * @return Shipping
362
         */
363
        public function setName02($name02)
364
        {
365
            $this->name02 = $name02;
366
367
            return $this;
368
        }
369
370
        /**
371
         * Get name02.
372
         *
373
         * @return string
374
         */
375
        public function getName02()
376
        {
377
            return $this->name02;
378
        }
379
380
        /**
381
         * Set kana01.
382
         *
383
         * @param string $kana01
384
         *
385
         * @return Shipping
386
         */
387
        public function setKana01($kana01)
388
        {
389
            $this->kana01 = $kana01;
390
391
            return $this;
392
        }
393
394
        /**
395
         * Get kana01.
396
         *
397
         * @return string
398
         */
399
        public function getKana01()
400
        {
401
            return $this->kana01;
402
        }
403
404
        /**
405
         * Set kana02.
406
         *
407
         * @param string $kana02
408
         *
409
         * @return Shipping
410
         */
411
        public function setKana02($kana02)
412
        {
413
            $this->kana02 = $kana02;
414
415
            return $this;
416
        }
417
418
        /**
419
         * Get kana02.
420
         *
421
         * @return string
422
         */
423
        public function getKana02()
424
        {
425
            return $this->kana02;
426
        }
427
428
        /**
429
         * Set companyName.
430
         *
431
         * @param string|null $companyName
432
         *
433
         * @return Shipping
434
         */
435
        public function setCompanyName($companyName = null)
436
        {
437
            $this->company_name = $companyName;
438
439
            return $this;
440
        }
441
442
        /**
443
         * Get companyName.
444
         *
445
         * @return string|null
446
         */
447
        public function getCompanyName()
448
        {
449
            return $this->company_name;
450
        }
451
452
        /**
453
         * Set phone_number.
454
         *
455
         * @param string|null $phone_number
456
         *
457
         * @return Shipping
458
         */
459
        public function setPhoneNumber($phone_number = null)
460
        {
461
            $this->phone_number = $phone_number;
462
463
            return $this;
464
        }
465
466
        /**
467
         * Get phone_number.
468
         *
469
         * @return string|null
470
         */
471
        public function getPhoneNumber()
472
        {
473
            return $this->phone_number;
474
        }
475
476
        /**
477
         * Set postal_code.
478
         *
479
         * @param string|null $postal_code
480
         *
481
         * @return Shipping
482
         */
483
        public function setPostalCode($postal_code = null)
484
        {
485
            $this->postal_code = $postal_code;
486
487
            return $this;
488
        }
489
490
        /**
491
         * Get postal_code.
492
         *
493
         * @return string|null
494
         */
495
        public function getPostalCode()
496
        {
497
            return $this->postal_code;
498
        }
499
500
        /**
501
         * Set addr01.
502
         *
503
         * @param string|null $addr01
504
         *
505
         * @return Shipping
506
         */
507
        public function setAddr01($addr01 = null)
508
        {
509
            $this->addr01 = $addr01;
510
511
            return $this;
512
        }
513
514
        /**
515
         * Get addr01.
516
         *
517
         * @return string|null
518
         */
519
        public function getAddr01()
520
        {
521
            return $this->addr01;
522
        }
523
524
        /**
525
         * Set addr02.
526
         *
527
         * @param string|null $addr02
528
         *
529
         * @return Shipping
530
         */
531
        public function setAddr02($addr02 = null)
532
        {
533
            $this->addr02 = $addr02;
534
535
            return $this;
536
        }
537
538
        /**
539
         * Get addr02.
540
         *
541
         * @return string|null
542
         */
543
        public function getAddr02()
544
        {
545
            return $this->addr02;
546
        }
547
548
        /**
549
         * Set shippingDeliveryName.
550
         *
551
         * @param string|null $shippingDeliveryName
552
         *
553
         * @return Shipping
554
         */
555
        public function setShippingDeliveryName($shippingDeliveryName = null)
556
        {
557
            $this->shipping_delivery_name = $shippingDeliveryName;
558
559
            return $this;
560
        }
561
562
        /**
563
         * Get shippingDeliveryName.
564
         *
565
         * @return string|null
566
         */
567
        public function getShippingDeliveryName()
568
        {
569
            return $this->shipping_delivery_name;
570
        }
571
572
        /**
573
         * Set shippingDeliveryTime.
574
         *
575
         * @param string|null $shippingDeliveryTime
576
         *
577
         * @return Shipping
578
         */
579
        public function setShippingDeliveryTime($shippingDeliveryTime = null)
580
        {
581
            $this->shipping_delivery_time = $shippingDeliveryTime;
582
583
            return $this;
584
        }
585
586
        /**
587
         * Get shippingDeliveryTime.
588
         *
589
         * @return string|null
590
         */
591
        public function getShippingDeliveryTime()
592
        {
593
            return $this->shipping_delivery_time;
594
        }
595
596
        /**
597
         * Set shippingDeliveryDate.
598
         *
599
         * @param \DateTime|null $shippingDeliveryDate
600
         *
601
         * @return Shipping
602
         */
603
        public function setShippingDeliveryDate($shippingDeliveryDate = null)
604
        {
605
            $this->shipping_delivery_date = $shippingDeliveryDate;
606
607
            return $this;
608
        }
609
610
        /**
611
         * Get shippingDeliveryDate.
612
         *
613
         * @return \DateTime|null
614
         */
615
        public function getShippingDeliveryDate()
616
        {
617
            return $this->shipping_delivery_date;
618
        }
619
620
        /**
621
         * Set shippingDeliveryFee.
622
         *
623
         * @param string|null $shippingDeliveryFee
624
         *
625
         * @return Shipping
626
         */
627
        public function setShippingDeliveryFee($shippingDeliveryFee = null)
628
        {
629
            $this->shipping_delivery_fee = $shippingDeliveryFee;
630
631
            return $this;
632
        }
633
634
        /**
635
         * Get shippingDeliveryFee.
636
         *
637
         * @return string|null
638
         */
639
        public function getShippingDeliveryFee()
640
        {
641
            return $this->shipping_delivery_fee;
642
        }
643
644
        /**
645
         * Set shippingDate.
646
         *
647
         * @param \DateTime|null $shippingDate
648
         *
649
         * @return Shipping
650
         */
651
        public function setShippingDate($shippingDate = null)
652
        {
653
            $this->shipping_date = $shippingDate;
654
655
            return $this;
656
        }
657
658
        /**
659
         * Get shippingDate.
660
         *
661
         * @return \DateTime|null
662
         */
663
        public function getShippingDate()
664
        {
665
            return $this->shipping_date;
666
        }
667
668
        /**
669
         * Set sortNo.
670
         *
671
         * @param int|null $sortNo
672
         *
673
         * @return Shipping
674
         */
675
        public function setSortNo($sortNo = null)
676
        {
677
            $this->sort_no = $sortNo;
678
679
            return $this;
680
        }
681
682
        /**
683
         * Get sortNo.
684
         *
685
         * @return int|null
686
         */
687
        public function getSortNo()
688
        {
689
            return $this->sort_no;
690
        }
691
692
        /**
693
         * Set createDate.
694
         *
695
         * @param \DateTime $createDate
696
         *
697
         * @return Shipping
698
         */
699
        public function setCreateDate($createDate)
700
        {
701
            $this->create_date = $createDate;
702
703
            return $this;
704
        }
705
706
        /**
707
         * Get createDate.
708
         *
709
         * @return \DateTime
710
         */
711
        public function getCreateDate()
712
        {
713
            return $this->create_date;
714
        }
715
716
        /**
717
         * Set updateDate.
718
         *
719
         * @param \DateTime $updateDate
720
         *
721
         * @return Shipping
722
         */
723
        public function setUpdateDate($updateDate)
724
        {
725
            $this->update_date = $updateDate;
726
727
            return $this;
728
        }
729
730
        /**
731
         * Get updateDate.
732
         *
733
         * @return \DateTime
734
         */
735
        public function getUpdateDate()
736
        {
737
            return $this->update_date;
738
        }
739
740
        /**
741
         * Set mailSendDate.
742
         *
743
         * @param \DateTime $mailSendDate
744
         *
745
         * @return Shipping
746
         */
747
        public function setMailSendDate($mailSendDate)
748
        {
749
            $this->mail_send_date = $mailSendDate;
750
751
            return $this;
752
        }
753
754
        /**
755
         * Get mailSendDate.
756
         *
757
         * @return \DateTime
758
         */
759
        public function getMailSendDate()
760
        {
761
            return $this->mail_send_date;
762
        }
763
764
        /**
765
         * Add orderItem.
766
         *
767
         * @param \Eccube\Entity\OrderItem $OrderItem
768
         *
769
         * @return Shipping
770
         */
771
        public function addOrderItem(\Eccube\Entity\OrderItem $OrderItem)
772
        {
773
            $this->OrderItems[] = $OrderItem;
774
775
            return $this;
776
        }
777
778
        /**
779
         * Remove orderItem.
780
         *
781
         * @param \Eccube\Entity\OrderItem $OrderItem
782
         *
783
         * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
784
         */
785
        public function removeOrderItem(\Eccube\Entity\OrderItem $OrderItem)
786
        {
787
            return $this->OrderItems->removeElement($OrderItem);
788
        }
789
790
        /**
791
         * Get orderItems.
792
         *
793
         * @return \Doctrine\Common\Collections\Collection
794
         */
795
        public function getOrderItems()
796
        {
797
            return (new ItemCollection($this->OrderItems))->sort();
798
        }
799
800
        /**
801
         * 商品の受注明細を取得
802
         *
803
         * @return OrderItem[]
804
         */
805
        public function getProductOrderItems()
806
        {
807
            $sio = new OrderItemCollection($this->OrderItems->toArray());
808
809
            return $sio->getProductClasses()->toArray();
810
        }
811
812
        /**
813
         * Set country.
814
         *
815
         * @param \Eccube\Entity\Master\Country|null $country
816
         *
817
         * @return Shipping
818
         */
819
        public function setCountry(\Eccube\Entity\Master\Country $country = null)
820
        {
821
            $this->Country = $country;
822
823
            return $this;
824
        }
825
826
        /**
827
         * Get country.
828
         *
829
         * @return \Eccube\Entity\Master\Country|null
830
         */
831
        public function getCountry()
832
        {
833
            return $this->Country;
834
        }
835
836
        /**
837
         * Set pref.
838
         *
839
         * @param \Eccube\Entity\Master\Pref|null $pref
840
         *
841
         * @return Shipping
842
         */
843
        public function setPref(\Eccube\Entity\Master\Pref $pref = null)
844
        {
845
            $this->Pref = $pref;
846
847
            return $this;
848
        }
849
850
        /**
851
         * Get pref.
852
         *
853
         * @return \Eccube\Entity\Master\Pref|null
854
         */
855
        public function getPref()
856
        {
857
            return $this->Pref;
858
        }
859
860
        /**
861
         * Set delivery.
862
         *
863
         * @param \Eccube\Entity\Delivery|null $delivery
864
         *
865
         * @return Shipping
866
         */
867
        public function setDelivery(\Eccube\Entity\Delivery $delivery = null)
868
        {
869
            $this->Delivery = $delivery;
870
871
            return $this;
872
        }
873
874
        /**
875
         * Get delivery.
876
         *
877
         * @return \Eccube\Entity\Delivery|null
878
         */
879
        public function getDelivery()
880
        {
881
            return $this->Delivery;
882
        }
883
884
        /**
885
         * Product class of shipment item (temp)
886
         *
887
         * @return \Eccube\Entity\ProductClass
888
         */
889
        public function getProductClassOfTemp()
890
        {
891
            return $this->ProductClassOfTemp;
892
        }
893
894
        /**
895
         * Product class of shipment item (temp)
896
         *
897
         * @param \Eccube\Entity\ProductClass $ProductClassOfTemp
898
         *
899
         * @return $this
900
         */
901
        public function setProductClassOfTemp(\Eccube\Entity\ProductClass $ProductClassOfTemp)
902
        {
903
            $this->ProductClassOfTemp = $ProductClassOfTemp;
904
905
            return $this;
906
        }
907
908
        /**
909
         * Set order.
910
         *
911
         * @param Order $Order
912
         *
913
         * @return $this
914
         */
915
        public function setOrder(Order $Order)
916
        {
917
            $this->Order = $Order;
918
919
            return $this;
920
        }
921
922
        /**
923
         * Get order.
924
         *
925
         * @return Order
926
         */
927
        public function getOrder()
928
        {
929
            return $this->Order;
930
        }
931
932
        /**
933
         * Set trackingNumber
934
         *
935
         * @param string $trackingNumber
936
         *
937
         * @return Shipping
938
         */
939
        public function setTrackingNumber($trackingNumber)
940
        {
941
            $this->tracking_number = $trackingNumber;
942
943
            return $this;
944
        }
945
946
        /**
947
         * Get trackingNumber
948
         *
949
         * @return string
950
         */
951
        public function getTrackingNumber()
952
        {
953
            return $this->tracking_number;
954
        }
955
956
        /**
957
         * Set note.
958
         *
959
         * @param string|null $note
960
         *
961
         * @return Shipping
962
         */
963
        public function setNote($note = null)
964
        {
965
            $this->note = $note;
966
967
            return $this;
968
        }
969
970
        /**
971
         * Get note.
972
         *
973
         * @return string|null
974
         */
975
        public function getNote()
976
        {
977
            return $this->note;
978
        }
979
980
        /**
981
         * 出荷済みの場合はtrue, 未出荷の場合はfalseを返す
982
         *
983
         * @return boolean
984
         */
985
        public function isShipped()
986
        {
987
            return !is_null($this->shipping_date);
988
        }
989
990
        /**
991
         * Set timeId
992
         *
993
         * @param integer $timeId
994
         *
995
         * @return Shipping
996
         */
997
        public function setTimeId($timeId)
998
        {
999
            $this->time_id = $timeId;
1000
1001
            return $this;
1002
        }
1003
1004
        /**
1005
         * Get timeId
1006
         *
1007
         * @return integer
1008
         */
1009
        public function getTimeId()
1010
        {
1011
            return $this->time_id;
1012
        }
1013
1014
        /**
1015
         * Set feeId
1016
         *
1017
         * @param integer $feeId
1018
         *
1019
         * @return Shipping
1020
         */
1021
        public function setFeeId($feeId)
1022
        {
1023
            $this->fee_id = $feeId;
1024
1025
            return $this;
1026
        }
1027
1028
        /**
1029
         * Get feeId
1030
         *
1031
         * @return integer
1032
         */
1033
        public function getFeeId()
1034
        {
1035
            return $this->fee_id;
1036
        }
1037
1038
        /**
1039
         * Set creator.
1040
         *
1041
         * @param \Eccube\Entity\Member|null $creator
1042
         *
1043
         * @return Shipping
1044
         */
1045
        public function setCreator(\Eccube\Entity\Member $creator = null)
1046
        {
1047
            $this->Creator = $creator;
1048
1049
            return $this;
1050
        }
1051
1052
        /**
1053
         * Get creator.
1054
         *
1055
         * @return \Eccube\Entity\Member|null
1056
         */
1057
        public function getCreator()
1058
        {
1059
            return $this->Creator;
1060
        }
1061
    }
1062
}
1063