These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
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 | 1 | 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 | 26 | /** |
|
35 | * 出荷メール未送信 |
||
36 | 26 | */ |
|
37 | const SHIPPING_MAIL_UNSENT = 1; |
||
38 | /** |
||
39 | * 出荷メール送信済 |
||
40 | */ |
||
41 | const SHIPPING_MAIL_SENT = 2; |
||
42 | |||
43 | public function getShippingMultipleDefaultName() |
||
44 | { |
||
45 | return $this->getName01().' '.$this->getPref()->getName().' '.$this->getAddr01().' '.$this->getAddr02(); |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @var int |
||
50 | * |
||
51 | * @ORM\Column(name="id", type="integer", options={"unsigned":true}) |
||
52 | * @ORM\Id |
||
53 | * @ORM\GeneratedValue(strategy="IDENTITY") |
||
54 | */ |
||
55 | private $id; |
||
56 | |||
57 | /** |
||
58 | * @var string |
||
59 | * |
||
60 | * @ORM\Column(name="name01", type="string", length=255) |
||
61 | */ |
||
62 | private $name01; |
||
63 | |||
64 | /** |
||
65 | * @var string |
||
66 | * |
||
67 | * @ORM\Column(name="name02", type="string", length=255) |
||
68 | */ |
||
69 | private $name02; |
||
70 | |||
71 | /** |
||
72 | * @var string |
||
73 | * |
||
74 | * @ORM\Column(name="kana01", type="string", length=255, nullable=true) |
||
75 | */ |
||
76 | private $kana01; |
||
77 | |||
78 | /** |
||
79 | * @var string |
||
80 | * |
||
81 | * @ORM\Column(name="kana02", type="string", length=255, nullable=true) |
||
82 | */ |
||
83 | private $kana02; |
||
84 | |||
85 | /** |
||
86 | * @var string|null |
||
87 | * |
||
88 | * @ORM\Column(name="company_name", type="string", length=255, nullable=true) |
||
89 | */ |
||
90 | private $company_name; |
||
91 | |||
92 | /** |
||
93 | * @var string|null |
||
94 | * |
||
95 | * @ORM\Column(name="phone_number", type="string", length=14, nullable=true) |
||
96 | */ |
||
97 | private $phone_number; |
||
98 | |||
99 | /** |
||
100 | * @var string|null |
||
101 | * |
||
102 | * @ORM\Column(name="postal_code", type="string", length=8, nullable=true) |
||
103 | */ |
||
104 | private $postal_code; |
||
105 | |||
106 | /** |
||
107 | * @var string|null |
||
108 | * |
||
109 | * @ORM\Column(name="addr01", type="string", length=255, nullable=true) |
||
110 | */ |
||
111 | private $addr01; |
||
112 | |||
113 | /** |
||
114 | * @var string|null |
||
115 | * |
||
116 | * @ORM\Column(name="addr02", type="string", length=255, nullable=true) |
||
117 | */ |
||
118 | private $addr02; |
||
119 | |||
120 | /** |
||
121 | * @var string|null |
||
122 | * |
||
123 | * @ORM\Column(name="delivery_name", type="string", length=255, nullable=true) |
||
124 | */ |
||
125 | private $shipping_delivery_name; |
||
126 | |||
127 | /** |
||
128 | * @var int |
||
129 | * |
||
130 | * @ORM\Column(name="time_id", type="integer", options={"unsigned":true}, nullable=true) |
||
131 | */ |
||
132 | private $time_id; |
||
133 | |||
134 | /** |
||
135 | * @var string|null |
||
136 | * |
||
137 | * @ORM\Column(name="delivery_time", type="string", length=255, nullable=true) |
||
138 | */ |
||
139 | private $shipping_delivery_time; |
||
140 | |||
141 | /** |
||
142 | * お届け予定日/お届け希望日 |
||
143 | * |
||
144 | * @var \DateTime|null |
||
145 | * |
||
146 | * @ORM\Column(name="delivery_date", type="datetimetz", nullable=true) |
||
147 | */ |
||
148 | private $shipping_delivery_date; |
||
149 | |||
150 | /** |
||
151 | * 出荷日 |
||
152 | * |
||
153 | * @var \DateTime|null |
||
154 | * |
||
155 | * @ORM\Column(name="shipping_date", type="datetimetz", nullable=true) |
||
156 | */ |
||
157 | private $shipping_date; |
||
158 | |||
159 | /** |
||
160 | * @var string |
||
161 | * |
||
162 | * @ORM\Column(name="tracking_number", type="string", length=255, nullable=true) |
||
163 | */ |
||
164 | private $tracking_number; |
||
165 | |||
166 | /** |
||
167 | * @var string |
||
168 | * |
||
169 | * @ORM\Column(name="note", type="string", length=4000, nullable=true) |
||
170 | */ |
||
171 | private $note; |
||
172 | |||
173 | /** |
||
174 | * @var int|null |
||
175 | * |
||
176 | * @ORM\Column(name="sort_no", type="smallint", nullable=true, options={"unsigned":true}) |
||
177 | */ |
||
178 | private $sort_no; |
||
179 | |||
180 | /** |
||
181 | * @var \DateTime |
||
182 | * |
||
183 | * @ORM\Column(name="create_date", type="datetimetz") |
||
184 | */ |
||
185 | private $create_date; |
||
186 | |||
187 | /** |
||
188 | * @var \DateTime |
||
189 | * |
||
190 | * @ORM\Column(name="update_date", type="datetimetz") |
||
191 | */ |
||
192 | private $update_date; |
||
193 | |||
194 | /** |
||
195 | * @var \DateTime |
||
196 | * |
||
197 | * @ORM\Column(name="mail_send_date", type="datetimetz", nullable=true) |
||
198 | */ |
||
199 | private $mail_send_date; |
||
200 | |||
201 | /** |
||
202 | * @var \Eccube\Entity\Order |
||
203 | * |
||
204 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Order", inversedBy="Shippings", cascade={"persist"}) |
||
205 | * @ORM\JoinColumns({ |
||
206 | * @ORM\JoinColumn(name="order_id", referencedColumnName="id") |
||
207 | * }) |
||
208 | */ |
||
209 | private $Order; |
||
210 | |||
211 | /** |
||
212 | * @var \Doctrine\Common\Collections\Collection |
||
213 | * |
||
214 | * @ORM\OneToMany(targetEntity="Eccube\Entity\OrderItem", mappedBy="Shipping", cascade={"persist"}) |
||
215 | */ |
||
216 | private $OrderItems; |
||
217 | |||
218 | /** |
||
219 | * @var \Eccube\Entity\Master\Country |
||
220 | * |
||
221 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Country") |
||
222 | * @ORM\JoinColumns({ |
||
223 | * @ORM\JoinColumn(name="country_id", referencedColumnName="id") |
||
224 | * }) |
||
225 | */ |
||
226 | private $Country; |
||
227 | |||
228 | /** |
||
229 | * @var \Eccube\Entity\Master\Pref |
||
230 | * |
||
231 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Pref") |
||
232 | * @ORM\JoinColumns({ |
||
233 | * @ORM\JoinColumn(name="pref_id", referencedColumnName="id") |
||
234 | * }) |
||
235 | */ |
||
236 | private $Pref; |
||
237 | |||
238 | /** |
||
239 | * @var \Eccube\Entity\Delivery |
||
240 | * |
||
241 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Delivery") |
||
242 | * @ORM\JoinColumns({ |
||
243 | * @ORM\JoinColumn(name="delivery_id", referencedColumnName="id") |
||
244 | * }) |
||
245 | */ |
||
246 | private $Delivery; |
||
247 | |||
248 | /** |
||
249 | * @var \Eccube\Entity\ProductClass |
||
250 | */ |
||
251 | private $ProductClassOfTemp; |
||
252 | |||
253 | /** |
||
254 | * @var \Eccube\Entity\Member |
||
255 | * |
||
256 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member") |
||
257 | * @ORM\JoinColumns({ |
||
258 | * @ORM\JoinColumn(name="creator_id", referencedColumnName="id") |
||
259 | * }) |
||
260 | */ |
||
261 | private $Creator; |
||
262 | |||
263 | /** |
||
264 | * Constructor |
||
265 | */ |
||
266 | public function __construct() |
||
267 | { |
||
268 | $this->OrderItems = new \Doctrine\Common\Collections\ArrayCollection(); |
||
269 | } |
||
270 | |||
271 | 230 | /** |
|
272 | * CustomerAddress から個人情報を設定. |
||
273 | 230 | * |
|
274 | * @param \Eccube\Entity\CustomerAddress $CustomerAddress |
||
275 | * |
||
276 | * @return \Eccube\Entity\Shipping |
||
277 | */ |
||
278 | View Code Duplication | public function setFromCustomerAddress(CustomerAddress $CustomerAddress) |
|
0 ignored issues
–
show
|
|||
279 | { |
||
280 | $this |
||
281 | ->setName01($CustomerAddress->getName01()) |
||
282 | ->setName02($CustomerAddress->getName02()) |
||
283 | 25 | ->setKana01($CustomerAddress->getKana01()) |
|
284 | ->setKana02($CustomerAddress->getKana02()) |
||
285 | ->setCompanyName($CustomerAddress->getCompanyName()) |
||
286 | 25 | ->setPhoneNumber($CustomerAddress->getPhonenumber()) |
|
287 | 25 | ->setPostalCode($CustomerAddress->getPostalCode()) |
|
288 | 25 | ->setPref($CustomerAddress->getPref()) |
|
289 | 25 | ->setAddr01($CustomerAddress->getAddr01()) |
|
290 | 25 | ->setAddr02($CustomerAddress->getAddr02()); |
|
291 | 25 | ||
292 | 25 | return $this; |
|
293 | 25 | } |
|
294 | 25 | ||
295 | 25 | /** |
|
296 | * 個人情報をクリア. |
||
297 | 25 | * |
|
298 | * @return \Eccube\Entity\Shipping |
||
299 | */ |
||
300 | public function clearCustomerAddress() |
||
301 | { |
||
302 | $this |
||
303 | ->setName01(null) |
||
304 | ->setName02(null) |
||
305 | ->setKana01(null) |
||
306 | ->setKana02(null) |
||
307 | ->setCompanyName(null) |
||
308 | ->setPhoneNumber(null) |
||
309 | ->setPostalCode(null) |
||
310 | ->setPref(null) |
||
311 | ->setAddr01(null) |
||
312 | ->setAddr02(null); |
||
313 | |||
314 | return $this; |
||
315 | } |
||
316 | |||
317 | /** |
||
318 | * Get id. |
||
319 | * |
||
320 | * @return int |
||
321 | */ |
||
322 | public function getId() |
||
323 | { |
||
324 | return $this->id; |
||
325 | } |
||
326 | |||
327 | 98 | /** |
|
328 | * Set name01. |
||
329 | 98 | * |
|
330 | * @param string $name01 |
||
331 | * |
||
332 | * @return Shipping |
||
333 | */ |
||
334 | public function setName01($name01) |
||
335 | { |
||
336 | $this->name01 = $name01; |
||
337 | |||
338 | return $this; |
||
339 | 80 | } |
|
340 | |||
341 | 80 | /** |
|
342 | * Get name01. |
||
343 | 80 | * |
|
344 | * @return string |
||
345 | */ |
||
346 | public function getName01() |
||
347 | { |
||
348 | return $this->name01; |
||
349 | } |
||
350 | |||
351 | 86 | /** |
|
352 | * Set name02. |
||
353 | 86 | * |
|
354 | * @param string $name02 |
||
355 | * |
||
356 | * @return Shipping |
||
357 | */ |
||
358 | public function setName02($name02) |
||
359 | { |
||
360 | $this->name02 = $name02; |
||
361 | |||
362 | return $this; |
||
363 | 69 | } |
|
364 | |||
365 | 69 | /** |
|
366 | * Get name02. |
||
367 | 69 | * |
|
368 | * @return string |
||
369 | */ |
||
370 | public function getName02() |
||
371 | { |
||
372 | return $this->name02; |
||
373 | } |
||
374 | |||
375 | 84 | /** |
|
376 | * Set kana01. |
||
377 | 84 | * |
|
378 | * @param string $kana01 |
||
379 | * |
||
380 | * @return Shipping |
||
381 | */ |
||
382 | public function setKana01($kana01) |
||
383 | { |
||
384 | $this->kana01 = $kana01; |
||
385 | |||
386 | return $this; |
||
387 | 68 | } |
|
388 | |||
389 | 68 | /** |
|
390 | * Get kana01. |
||
391 | 68 | * |
|
392 | * @return string |
||
393 | */ |
||
394 | public function getKana01() |
||
395 | { |
||
396 | return $this->kana01; |
||
397 | } |
||
398 | |||
399 | 77 | /** |
|
400 | * Set kana02. |
||
401 | 77 | * |
|
402 | * @param string $kana02 |
||
403 | * |
||
404 | * @return Shipping |
||
405 | */ |
||
406 | public function setKana02($kana02) |
||
407 | { |
||
408 | $this->kana02 = $kana02; |
||
409 | |||
410 | return $this; |
||
411 | 68 | } |
|
412 | |||
413 | 68 | /** |
|
414 | * Get kana02. |
||
415 | 68 | * |
|
416 | * @return string |
||
417 | */ |
||
418 | public function getKana02() |
||
419 | { |
||
420 | return $this->kana02; |
||
421 | } |
||
422 | |||
423 | 76 | /** |
|
424 | * Set companyName. |
||
425 | 76 | * |
|
426 | * @param string|null $companyName |
||
427 | * |
||
428 | * @return Shipping |
||
429 | */ |
||
430 | public function setCompanyName($companyName = null) |
||
431 | { |
||
432 | $this->company_name = $companyName; |
||
433 | |||
434 | return $this; |
||
435 | 55 | } |
|
436 | |||
437 | 55 | /** |
|
438 | * Get companyName. |
||
439 | 55 | * |
|
440 | * @return string|null |
||
441 | */ |
||
442 | public function getCompanyName() |
||
443 | { |
||
444 | return $this->company_name; |
||
445 | } |
||
446 | |||
447 | 37 | /** |
|
448 | * Set phone_number. |
||
449 | 37 | * |
|
450 | * @param string|null $phone_number |
||
451 | * |
||
452 | * @return Shipping |
||
453 | */ |
||
454 | public function setPhoneNumber($phone_number = null) |
||
455 | { |
||
456 | $this->phone_number = $phone_number; |
||
457 | |||
458 | return $this; |
||
459 | 68 | } |
|
460 | |||
461 | 68 | /** |
|
462 | * Get phone_number. |
||
463 | 68 | * |
|
464 | * @return string|null |
||
465 | */ |
||
466 | public function getPhoneNumber() |
||
467 | { |
||
468 | return $this->phone_number; |
||
469 | } |
||
470 | |||
471 | 76 | /** |
|
472 | * Set postal_code. |
||
473 | 76 | * |
|
474 | * @param string|null $postal_code |
||
475 | * |
||
476 | * @return Shipping |
||
477 | */ |
||
478 | public function setPostalCode($postal_code = null) |
||
479 | { |
||
480 | $this->postal_code = $postal_code; |
||
481 | |||
482 | return $this; |
||
483 | 68 | } |
|
484 | |||
485 | 68 | /** |
|
486 | * Get postal_code. |
||
487 | 68 | * |
|
488 | * @return string|null |
||
489 | */ |
||
490 | public function getPostalCode() |
||
491 | { |
||
492 | return $this->postal_code; |
||
493 | } |
||
494 | |||
495 | 76 | /** |
|
496 | * Set addr01. |
||
497 | 76 | * |
|
498 | * @param string|null $addr01 |
||
499 | * |
||
500 | * @return Shipping |
||
501 | */ |
||
502 | public function setAddr01($addr01 = null) |
||
503 | { |
||
504 | $this->addr01 = $addr01; |
||
505 | |||
506 | return $this; |
||
507 | 68 | } |
|
508 | |||
509 | 68 | /** |
|
510 | * Get addr01. |
||
511 | 68 | * |
|
512 | * @return string|null |
||
513 | */ |
||
514 | public function getAddr01() |
||
515 | { |
||
516 | return $this->addr01; |
||
517 | } |
||
518 | |||
519 | 76 | /** |
|
520 | * Set addr02. |
||
521 | 76 | * |
|
522 | * @param string|null $addr02 |
||
523 | * |
||
524 | * @return Shipping |
||
525 | */ |
||
526 | public function setAddr02($addr02 = null) |
||
527 | { |
||
528 | $this->addr02 = $addr02; |
||
529 | |||
530 | return $this; |
||
531 | 68 | } |
|
532 | |||
533 | 68 | /** |
|
534 | * Get addr02. |
||
535 | 68 | * |
|
536 | * @return string|null |
||
537 | */ |
||
538 | public function getAddr02() |
||
539 | { |
||
540 | return $this->addr02; |
||
541 | } |
||
542 | |||
543 | 76 | /** |
|
544 | * Set shippingDeliveryName. |
||
545 | 76 | * |
|
546 | * @param string|null $shippingDeliveryName |
||
547 | * |
||
548 | * @return Shipping |
||
549 | */ |
||
550 | public function setShippingDeliveryName($shippingDeliveryName = null) |
||
551 | { |
||
552 | $this->shipping_delivery_name = $shippingDeliveryName; |
||
553 | |||
554 | return $this; |
||
555 | 218 | } |
|
556 | |||
557 | 218 | /** |
|
558 | * Get shippingDeliveryName. |
||
559 | 218 | * |
|
560 | * @return string|null |
||
561 | */ |
||
562 | public function getShippingDeliveryName() |
||
563 | { |
||
564 | return $this->shipping_delivery_name; |
||
565 | } |
||
566 | |||
567 | 1 | /** |
|
568 | * Set shippingDeliveryTime. |
||
569 | 1 | * |
|
570 | * @param string|null $shippingDeliveryTime |
||
571 | * |
||
572 | * @return Shipping |
||
573 | */ |
||
574 | public function setShippingDeliveryTime($shippingDeliveryTime = null) |
||
575 | { |
||
576 | $this->shipping_delivery_time = $shippingDeliveryTime; |
||
577 | |||
578 | return $this; |
||
579 | 25 | } |
|
580 | |||
581 | 25 | /** |
|
582 | * Get shippingDeliveryTime. |
||
583 | 25 | * |
|
584 | * @return string|null |
||
585 | */ |
||
586 | public function getShippingDeliveryTime() |
||
587 | { |
||
588 | return $this->shipping_delivery_time; |
||
589 | } |
||
590 | |||
591 | 16 | /** |
|
592 | * Set shippingDeliveryDate. |
||
593 | 16 | * |
|
594 | * @param \DateTime|null $shippingDeliveryDate |
||
595 | * |
||
596 | * @return Shipping |
||
597 | */ |
||
598 | public function setShippingDeliveryDate($shippingDeliveryDate = null) |
||
599 | { |
||
600 | $this->shipping_delivery_date = $shippingDeliveryDate; |
||
601 | |||
602 | return $this; |
||
603 | 44 | } |
|
604 | |||
605 | 44 | /** |
|
606 | * Get shippingDeliveryDate. |
||
607 | 44 | * |
|
608 | * @return \DateTime|null |
||
609 | */ |
||
610 | public function getShippingDeliveryDate() |
||
611 | { |
||
612 | return $this->shipping_delivery_date; |
||
613 | } |
||
614 | |||
615 | 70 | /** |
|
616 | * Set shippingDate. |
||
617 | 70 | * |
|
618 | * @param \DateTime|null $shippingDate |
||
619 | * |
||
620 | * @return Shipping |
||
621 | */ |
||
622 | public function setShippingDate($shippingDate = null) |
||
623 | { |
||
624 | $this->shipping_date = $shippingDate; |
||
625 | |||
626 | return $this; |
||
627 | 205 | } |
|
628 | |||
629 | 205 | /** |
|
630 | * Get shippingDate. |
||
631 | 205 | * |
|
632 | * @return \DateTime|null |
||
633 | */ |
||
634 | public function getShippingDate() |
||
635 | { |
||
636 | return $this->shipping_date; |
||
637 | } |
||
638 | |||
639 | 205 | /** |
|
640 | * Set sortNo. |
||
641 | 205 | * |
|
642 | * @param int|null $sortNo |
||
643 | * |
||
644 | * @return Shipping |
||
645 | */ |
||
646 | public function setSortNo($sortNo = null) |
||
647 | { |
||
648 | $this->sort_no = $sortNo; |
||
649 | |||
650 | return $this; |
||
651 | 7 | } |
|
652 | |||
653 | 7 | /** |
|
654 | * Get sortNo. |
||
655 | 7 | * |
|
656 | * @return int|null |
||
657 | */ |
||
658 | public function getSortNo() |
||
659 | { |
||
660 | return $this->sort_no; |
||
661 | } |
||
662 | |||
663 | 22 | /** |
|
664 | * Set createDate. |
||
665 | 22 | * |
|
666 | * @param \DateTime $createDate |
||
667 | * |
||
668 | * @return Shipping |
||
669 | */ |
||
670 | public function setCreateDate($createDate) |
||
671 | { |
||
672 | $this->create_date = $createDate; |
||
673 | |||
674 | return $this; |
||
675 | } |
||
676 | |||
677 | /** |
||
678 | * Get createDate. |
||
679 | * |
||
680 | * @return \DateTime |
||
681 | */ |
||
682 | public function getCreateDate() |
||
683 | { |
||
684 | return $this->create_date; |
||
685 | } |
||
686 | |||
687 | /** |
||
688 | * Set updateDate. |
||
689 | * |
||
690 | * @param \DateTime $updateDate |
||
691 | * |
||
692 | * @return Shipping |
||
693 | */ |
||
694 | public function setUpdateDate($updateDate) |
||
695 | { |
||
696 | $this->update_date = $updateDate; |
||
697 | |||
698 | return $this; |
||
699 | 207 | } |
|
700 | |||
701 | 207 | /** |
|
702 | * Get updateDate. |
||
703 | 207 | * |
|
704 | * @return \DateTime |
||
705 | */ |
||
706 | public function getUpdateDate() |
||
707 | { |
||
708 | return $this->update_date; |
||
709 | } |
||
710 | |||
711 | /** |
||
712 | * Set mailSendDate. |
||
713 | * |
||
714 | * @param \DateTime $mailSendDate |
||
715 | * |
||
716 | * @return Shipping |
||
717 | */ |
||
718 | public function setMailSendDate($mailSendDate) |
||
719 | { |
||
720 | $this->mail_send_date = $mailSendDate; |
||
721 | |||
722 | return $this; |
||
723 | 207 | } |
|
724 | |||
725 | 207 | /** |
|
726 | * Get mailSendDate. |
||
727 | 207 | * |
|
728 | * @return \DateTime |
||
729 | */ |
||
730 | public function getMailSendDate() |
||
731 | { |
||
732 | return $this->mail_send_date; |
||
733 | } |
||
734 | |||
735 | 3 | /** |
|
736 | * Add orderItem. |
||
737 | 3 | * |
|
738 | * @param \Eccube\Entity\OrderItem $OrderItem |
||
739 | * |
||
740 | * @return Shipping |
||
741 | */ |
||
742 | public function addOrderItem(\Eccube\Entity\OrderItem $OrderItem) |
||
743 | { |
||
744 | $this->OrderItems[] = $OrderItem; |
||
745 | |||
746 | return $this; |
||
747 | 3 | } |
|
748 | |||
749 | 3 | /** |
|
750 | * Remove orderItem. |
||
751 | 3 | * |
|
752 | * @param \Eccube\Entity\OrderItem $OrderItem |
||
753 | * |
||
754 | * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. |
||
755 | */ |
||
756 | public function removeOrderItem(\Eccube\Entity\OrderItem $OrderItem) |
||
757 | { |
||
758 | return $this->OrderItems->removeElement($OrderItem); |
||
759 | 9 | } |
|
760 | |||
761 | 9 | /** |
|
762 | * Get orderItems. |
||
763 | * |
||
764 | * @return \Doctrine\Common\Collections\Collection |
||
765 | */ |
||
766 | public function getOrderItems() |
||
767 | { |
||
768 | return (new ItemCollection($this->OrderItems))->sort(); |
||
769 | } |
||
770 | |||
771 | 216 | /** |
|
772 | * 商品の受注明細を取得 |
||
773 | 216 | * |
|
774 | * @return OrderItem[] |
||
775 | 216 | */ |
|
776 | public function getProductOrderItems() |
||
777 | { |
||
778 | $sio = new OrderItemCollection($this->OrderItems->toArray()); |
||
779 | |||
780 | return $sio->getProductClasses()->toArray(); |
||
781 | } |
||
782 | |||
783 | /** |
||
784 | * Set country. |
||
785 | 28 | * |
|
786 | * @param \Eccube\Entity\Master\Country|null $country |
||
787 | 28 | * |
|
788 | * @return Shipping |
||
789 | */ |
||
790 | public function setCountry(\Eccube\Entity\Master\Country $country = null) |
||
791 | { |
||
792 | $this->Country = $country; |
||
793 | |||
794 | return $this; |
||
795 | 90 | } |
|
796 | |||
797 | 90 | /** |
|
798 | * Get country. |
||
799 | * |
||
800 | * @return \Eccube\Entity\Master\Country|null |
||
801 | */ |
||
802 | public function getCountry() |
||
803 | { |
||
804 | return $this->Country; |
||
805 | 60 | } |
|
806 | |||
807 | 60 | /** |
|
808 | * Set pref. |
||
809 | 60 | * |
|
810 | * @param \Eccube\Entity\Master\Pref|null $pref |
||
811 | * |
||
812 | * @return Shipping |
||
813 | */ |
||
814 | public function setPref(\Eccube\Entity\Master\Pref $pref = null) |
||
815 | { |
||
816 | $this->Pref = $pref; |
||
817 | |||
818 | return $this; |
||
819 | } |
||
820 | |||
821 | /** |
||
822 | * Get pref. |
||
823 | * |
||
824 | * @return \Eccube\Entity\Master\Pref|null |
||
825 | */ |
||
826 | public function getPref() |
||
827 | { |
||
828 | return $this->Pref; |
||
829 | } |
||
830 | |||
831 | /** |
||
832 | * Set delivery. |
||
833 | * |
||
834 | * @param \Eccube\Entity\Delivery|null $delivery |
||
835 | * |
||
836 | * @return Shipping |
||
837 | */ |
||
838 | public function setDelivery(\Eccube\Entity\Delivery $delivery = null) |
||
839 | { |
||
840 | $this->Delivery = $delivery; |
||
841 | |||
842 | return $this; |
||
843 | 218 | } |
|
844 | |||
845 | 218 | /** |
|
846 | * Get delivery. |
||
847 | 218 | * |
|
848 | * @return \Eccube\Entity\Delivery|null |
||
849 | */ |
||
850 | public function getDelivery() |
||
851 | { |
||
852 | return $this->Delivery; |
||
853 | } |
||
854 | |||
855 | 90 | /** |
|
856 | * Product class of shipment item (temp) |
||
857 | 90 | * |
|
858 | * @return \Eccube\Entity\ProductClass |
||
859 | */ |
||
860 | public function getProductClassOfTemp() |
||
861 | { |
||
862 | return $this->ProductClassOfTemp; |
||
863 | } |
||
864 | |||
865 | /** |
||
866 | * Product class of shipment item (temp) |
||
867 | 218 | * |
|
868 | * @param \Eccube\Entity\ProductClass $ProductClassOfTemp |
||
869 | 218 | * |
|
870 | * @return $this |
||
871 | 218 | */ |
|
872 | public function setProductClassOfTemp(\Eccube\Entity\ProductClass $ProductClassOfTemp) |
||
873 | { |
||
874 | $this->ProductClassOfTemp = $ProductClassOfTemp; |
||
875 | |||
876 | return $this; |
||
877 | } |
||
878 | |||
879 | 74 | /** |
|
880 | * Set order. |
||
881 | 74 | * |
|
882 | * @param Order $Order |
||
883 | * |
||
884 | * @return $this |
||
885 | */ |
||
886 | public function setOrder(Order $Order) |
||
887 | { |
||
888 | $this->Order = $Order; |
||
889 | 26 | ||
890 | return $this; |
||
891 | 26 | } |
|
892 | |||
893 | /** |
||
894 | * Get order. |
||
895 | * |
||
896 | * @return Order |
||
897 | */ |
||
898 | public function getOrder() |
||
899 | { |
||
900 | return $this->Order; |
||
901 | 26 | } |
|
902 | |||
903 | 26 | /** |
|
904 | * Set trackingNumber |
||
905 | 26 | * |
|
906 | * @param string $trackingNumber |
||
907 | * |
||
908 | * @return Shipping |
||
909 | */ |
||
910 | public function setTrackingNumber($trackingNumber) |
||
911 | { |
||
912 | $this->tracking_number = $trackingNumber; |
||
913 | |||
914 | return $this; |
||
915 | 218 | } |
|
916 | |||
917 | 218 | /** |
|
918 | * Get trackingNumber |
||
919 | 218 | * |
|
920 | * @return string |
||
921 | */ |
||
922 | public function getTrackingNumber() |
||
923 | { |
||
924 | return $this->tracking_number; |
||
925 | } |
||
926 | |||
927 | 11 | /** |
|
928 | * Set note. |
||
929 | 11 | * |
|
930 | * @param string|null $note |
||
931 | * |
||
932 | * @return Shipping |
||
933 | */ |
||
934 | public function setNote($note = null) |
||
935 | { |
||
936 | $this->note = $note; |
||
937 | |||
938 | return $this; |
||
939 | 7 | } |
|
940 | |||
941 | 7 | /** |
|
942 | * Get note. |
||
943 | 7 | * |
|
944 | * @return string|null |
||
945 | */ |
||
946 | public function getNote() |
||
947 | { |
||
948 | return $this->note; |
||
949 | } |
||
950 | |||
951 | 38 | /** |
|
952 | * 出荷済みの場合はtrue, 未出荷の場合はfalseを返す |
||
953 | 38 | * |
|
954 | * @return boolean |
||
955 | */ |
||
956 | public function isShipped() |
||
957 | { |
||
958 | return !is_null($this->shipping_date); |
||
959 | } |
||
960 | |||
961 | /** |
||
962 | * Set timeId |
||
963 | * |
||
964 | * @param integer $timeId |
||
965 | * |
||
966 | * @return Shipping |
||
967 | */ |
||
968 | public function setTimeId($timeId) |
||
969 | { |
||
970 | $this->time_id = $timeId; |
||
971 | |||
972 | return $this; |
||
973 | } |
||
974 | |||
975 | 22 | /** |
|
976 | * Get timeId |
||
977 | 22 | * |
|
978 | * @return integer |
||
979 | */ |
||
980 | public function getTimeId() |
||
981 | { |
||
982 | return $this->time_id; |
||
983 | } |
||
984 | |||
985 | 1 | /** |
|
986 | * Set creator. |
||
987 | 1 | * |
|
988 | * @param \Eccube\Entity\Member|null $creator |
||
989 | * |
||
990 | * @return Shipping |
||
991 | */ |
||
992 | public function setCreator(\Eccube\Entity\Member $creator = null) |
||
993 | { |
||
994 | $this->Creator = $creator; |
||
995 | |||
996 | return $this; |
||
997 | 25 | } |
|
998 | |||
999 | 25 | /** |
|
1000 | * Get creator. |
||
1001 | 25 | * |
|
1002 | * @return \Eccube\Entity\Member|null |
||
1003 | */ |
||
1004 | public function getCreator() |
||
1005 | { |
||
1006 | return $this->Creator; |
||
1007 | } |
||
1008 | } |
||
1009 | } |
||
1010 |
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.