vasildakov /
speedy
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace VasilDakov\Speedy\Service\Shipment; |
||
| 6 | |||
| 7 | use VasilDakov\Speedy\Traits\ToArray; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Class ShipmentService. |
||
| 11 | * |
||
| 12 | * @author Valentin Valkanov <[email protected]> |
||
| 13 | * @author Vasil Dakov <[email protected]> |
||
| 14 | * @copyright |
||
| 15 | * |
||
| 16 | * @version |
||
| 17 | */ |
||
| 18 | class ShipmentService |
||
| 19 | { |
||
| 20 | use ToArray; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 21 | |||
| 22 | private ?\DateTime $pickupDate = null; |
||
| 23 | |||
| 24 | private bool $autoAdjustPickupDate = true; |
||
| 25 | |||
| 26 | private int $serviceId; |
||
| 27 | |||
| 28 | private ?ShipmentAdditionalServices $additionalServices = null; |
||
| 29 | |||
| 30 | private ?int $deferredDays = null; |
||
| 31 | |||
| 32 | private bool $saturdayDelivery = false; |
||
| 33 | |||
| 34 | 2 | public function __construct(int $serviceId) |
|
| 35 | { |
||
| 36 | 2 | $this->serviceId = $serviceId; |
|
| 37 | } |
||
| 38 | |||
| 39 | 1 | public function getPickupDate(): ?\DateTime |
|
| 40 | { |
||
| 41 | 1 | return $this->pickupDate; |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | public function setPickupDate(\DateTime $pickupDate): self |
|
| 45 | { |
||
| 46 | 1 | $this->pickupDate = $pickupDate; |
|
| 47 | |||
| 48 | 1 | return $this; |
|
| 49 | } |
||
| 50 | |||
| 51 | 1 | public function isAutoAdjustPickupDate(): bool |
|
| 52 | { |
||
| 53 | 1 | return $this->autoAdjustPickupDate; |
|
| 54 | } |
||
| 55 | |||
| 56 | 1 | public function setAutoAdjustPickupDate(bool $autoAdjustPickupDate): self |
|
| 57 | { |
||
| 58 | 1 | $this->autoAdjustPickupDate = $autoAdjustPickupDate; |
|
| 59 | |||
| 60 | 1 | return $this; |
|
| 61 | } |
||
| 62 | |||
| 63 | 2 | public function getServiceId(): ?int |
|
| 64 | { |
||
| 65 | 2 | return $this->serviceId; |
|
| 66 | } |
||
| 67 | |||
| 68 | 1 | public function setServiceId(int $serviceId): void |
|
| 69 | { |
||
| 70 | 1 | $this->serviceId = $serviceId; |
|
| 71 | } |
||
| 72 | |||
| 73 | 1 | public function getAdditionalServices(): ?ShipmentAdditionalServices |
|
| 74 | { |
||
| 75 | 1 | return $this->additionalServices; |
|
| 76 | } |
||
| 77 | |||
| 78 | 1 | public function setAdditionalServices(ShipmentAdditionalServices $additionalServices): self |
|
| 79 | { |
||
| 80 | 1 | $this->additionalServices = $additionalServices; |
|
| 81 | |||
| 82 | 1 | return $this; |
|
| 83 | } |
||
| 84 | |||
| 85 | 1 | public function getDeferredDays(): ?int |
|
| 86 | { |
||
| 87 | 1 | return $this->deferredDays; |
|
| 88 | } |
||
| 89 | |||
| 90 | 1 | public function setDeferredDays(int $deferredDays): self |
|
| 91 | { |
||
| 92 | 1 | $this->deferredDays = $deferredDays; |
|
| 93 | |||
| 94 | 1 | return $this; |
|
| 95 | } |
||
| 96 | |||
| 97 | 1 | public function isSaturdayDelivery(): bool |
|
| 98 | { |
||
| 99 | 1 | return $this->saturdayDelivery; |
|
| 100 | } |
||
| 101 | |||
| 102 | 1 | public function setSaturdayDelivery(bool $saturdayDelivery): self |
|
| 103 | { |
||
| 104 | 1 | $this->saturdayDelivery = $saturdayDelivery; |
|
| 105 | |||
| 106 | 1 | return $this; |
|
| 107 | } |
||
| 108 | } |
||
| 109 |