/
Shipment.php
executable file
·201 lines (173 loc) · 4.63 KB
/
Shipment.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<?php
declare(strict_types=1);
namespace Jtl\Connector\Core\Model;
use JMS\Serializer\Annotation as Serializer;
use Jtl\Connector\Core\Exception\MustNotBeNullException;
use Jtl\Connector\Core\Utilities\Validator\Validate;
/**
* Shipment Model with reference to a deliveryNote
*
* @access public
* @package Jtl\Connector\Core\Model
* @subpackage Product
* @Serializer\AccessType("public_method")
*/
class Shipment extends AbstractIdentity
{
/**
* @var Identity Reference to deliveryNote
* @Serializer\Type("Jtl\Connector\Core\Model\Identity")
* @Serializer\SerializedName("deliveryNoteId")
* @Serializer\Accessor(getter="getDeliveryNoteId",setter="setDeliveryNoteId")
*/
protected Identity $deliveryNoteId;
/**
* @var string Carrier name
* @Serializer\Type("string")
* @Serializer\SerializedName("carrierName")
* @Serializer\Accessor(getter="getCarrierName",setter="setCarrierName")
*/
protected string $carrierName = '';
/**
* @var \DateTimeInterface|null Creation date
* @Serializer\Type("DateTimeInterface")
* @Serializer\SerializedName("creationDate")
* @Serializer\Accessor(getter="getCreationDate",setter="setCreationDate")
*/
protected ?\DateTimeInterface $creationDate = null;
/**
* @var string Optional Identcode
* @Serializer\Type("string")
* @Serializer\SerializedName("identCode")
* @Serializer\Accessor(getter="getIdentCode",setter="setIdentCode")
*/
protected string $identCode = '';
/**
* @var string Optional shipment note
* @Serializer\Type("string")
* @Serializer\SerializedName("note")
* @Serializer\Accessor(getter="getNote",setter="setNote")
*/
protected string $note = '';
/**
* @var string
* @Serializer\Type("string")
* @Serializer\SerializedName("trackingUrl")
* @Serializer\Accessor(getter="getTrackingUrl",setter="setTrackingUrl")
*/
protected string $trackingUrl = '';
/**
* Constructor.
*
* @param string $endpoint
* @param int $host
*/
public function __construct(string $endpoint = '', int $host = 0)
{
parent::__construct($endpoint, $host);
$this->deliveryNoteId = new Identity();
}
/**
* @return Identity Reference to deliveryNote
* @throws MustNotBeNullException|\TypeError
*/
public function getDeliveryNoteId(): Identity
{
return Validate::checkIdentityAndNotNull($this->deliveryNoteId);
}
/**
* @param Identity $deliveryNoteId Reference to deliveryNote
*
* @return Shipment
*/
public function setDeliveryNoteId(Identity $deliveryNoteId): Shipment
{
$this->deliveryNoteId = $deliveryNoteId;
return $this;
}
/**
* @return string Carrier name
*/
public function getCarrierName(): string
{
return $this->carrierName;
}
/**
* @param string $carrierName Carrier name
*
* @return Shipment
*/
public function setCarrierName(string $carrierName): Shipment
{
$this->carrierName = $carrierName;
return $this;
}
/**
* @return \DateTimeInterface Creation date
*/
public function getCreationDate(): ?\DateTimeInterface
{
return $this->creationDate;
}
/**
* @param \DateTimeInterface $creationDate Creation date
*
* @return Shipment
*/
public function setCreationDate(\DateTimeInterface $creationDate = null): Shipment
{
$this->creationDate = $creationDate;
return $this;
}
/**
* @return string Optional Identcode
*/
public function getIdentCode(): string
{
return $this->identCode;
}
/**
* @param string $identCode Optional Identcode
*
* @return Shipment
*/
public function setIdentCode(string $identCode): Shipment
{
$this->identCode = $identCode;
return $this;
}
/**
* @return string Optional shipment note
*/
public function getNote(): string
{
return $this->note;
}
/**
* @param string $note Optional shipment note
*
* @return Shipment
*/
public function setNote(string $note): Shipment
{
$this->note = $note;
return $this;
}
/**
* @return string
*/
public function getTrackingUrl(): string
{
return $this->trackingUrl;
}
/**
* @param string $trackingUrl
*
* @return Shipment
*/
public function setTrackingUrl(string $trackingUrl): Shipment
{
$this->trackingUrl = $trackingUrl;
return $this;
}
}