commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
OrderFromCartDraftModel.php
1<?php
2
3declare(strict_types=1);
10
21use stdClass;
22
27{
32 protected $id;
33
38 protected $cart;
39
44 protected $version;
45
50 protected $orderNumber;
51
57
62 protected $paymentState;
63
68 protected $shipmentState;
69
74 protected $orderState;
75
80 protected $state;
81
86 protected $custom;
87
88
92 public function __construct(
93 ?string $id = null,
95 ?int $version = null,
96 ?string $orderNumber = null,
97 ?string $purchaseOrderNumber = null,
98 ?string $paymentState = null,
99 ?string $shipmentState = null,
100 ?string $orderState = null,
103 ) {
104 $this->id = $id;
105 $this->cart = $cart;
106 $this->version = $version;
107 $this->orderNumber = $orderNumber;
108 $this->purchaseOrderNumber = $purchaseOrderNumber;
109 $this->paymentState = $paymentState;
110 $this->shipmentState = $shipmentState;
111 $this->orderState = $orderState;
112 $this->state = $state;
113 $this->custom = $custom;
114 }
115
122 public function getId()
123 {
124 if (is_null($this->id)) {
126 $data = $this->raw(self::FIELD_ID);
127 if (is_null($data)) {
128 return null;
129 }
130 $this->id = (string) $data;
131 }
132
133 return $this->id;
134 }
135
143 public function getCart()
144 {
145 if (is_null($this->cart)) {
147 $data = $this->raw(self::FIELD_CART);
148 if (is_null($data)) {
149 return null;
150 }
151
152 $this->cart = CartResourceIdentifierModel::of($data);
153 }
154
155 return $this->cart;
156 }
157
164 public function getVersion()
165 {
166 if (is_null($this->version)) {
168 $data = $this->raw(self::FIELD_VERSION);
169 if (is_null($data)) {
170 return null;
171 }
172 $this->version = (int) $data;
173 }
174
175 return $this->version;
176 }
177
185 public function getOrderNumber()
186 {
187 if (is_null($this->orderNumber)) {
189 $data = $this->raw(self::FIELD_ORDER_NUMBER);
190 if (is_null($data)) {
191 return null;
192 }
193 $this->orderNumber = (string) $data;
194 }
195
196 return $this->orderNumber;
197 }
198
207 public function getPurchaseOrderNumber()
208 {
209 if (is_null($this->purchaseOrderNumber)) {
211 $data = $this->raw(self::FIELD_PURCHASE_ORDER_NUMBER);
212 if (is_null($data)) {
213 return null;
214 }
215 $this->purchaseOrderNumber = (string) $data;
216 }
217
219 }
220
227 public function getPaymentState()
228 {
229 if (is_null($this->paymentState)) {
231 $data = $this->raw(self::FIELD_PAYMENT_STATE);
232 if (is_null($data)) {
233 return null;
234 }
235 $this->paymentState = (string) $data;
236 }
237
238 return $this->paymentState;
239 }
240
247 public function getShipmentState()
248 {
249 if (is_null($this->shipmentState)) {
251 $data = $this->raw(self::FIELD_SHIPMENT_STATE);
252 if (is_null($data)) {
253 return null;
254 }
255 $this->shipmentState = (string) $data;
256 }
257
259 }
260
267 public function getOrderState()
268 {
269 if (is_null($this->orderState)) {
271 $data = $this->raw(self::FIELD_ORDER_STATE);
272 if (is_null($data)) {
273 return null;
274 }
275 $this->orderState = (string) $data;
276 }
277
278 return $this->orderState;
279 }
280
287 public function getState()
288 {
289 if (is_null($this->state)) {
291 $data = $this->raw(self::FIELD_STATE);
292 if (is_null($data)) {
293 return null;
294 }
295
296 $this->state = StateResourceIdentifierModel::of($data);
297 }
298
299 return $this->state;
300 }
301
313 public function getCustom()
314 {
315 if (is_null($this->custom)) {
317 $data = $this->raw(self::FIELD_CUSTOM);
318 if (is_null($data)) {
319 return null;
320 }
321
322 $this->custom = CustomFieldsDraftModel::of($data);
323 }
324
325 return $this->custom;
326 }
327
328
332 public function setId(?string $id): void
333 {
334 $this->id = $id;
335 }
336
340 public function setCart(?CartResourceIdentifier $cart): void
341 {
342 $this->cart = $cart;
343 }
344
348 public function setVersion(?int $version): void
349 {
350 $this->version = $version;
351 }
352
356 public function setOrderNumber(?string $orderNumber): void
357 {
358 $this->orderNumber = $orderNumber;
359 }
360
364 public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void
365 {
366 $this->purchaseOrderNumber = $purchaseOrderNumber;
367 }
368
372 public function setPaymentState(?string $paymentState): void
373 {
374 $this->paymentState = $paymentState;
375 }
376
380 public function setShipmentState(?string $shipmentState): void
381 {
382 $this->shipmentState = $shipmentState;
383 }
384
388 public function setOrderState(?string $orderState): void
389 {
390 $this->orderState = $orderState;
391 }
392
397 {
398 $this->state = $state;
399 }
400
404 public function setCustom(?CustomFieldsDraft $custom): void
405 {
406 $this->custom = $custom;
407 }
408}
__construct(?string $id=null, ?CartResourceIdentifier $cart=null, ?int $version=null, ?string $orderNumber=null, ?string $purchaseOrderNumber=null, ?string $paymentState=null, ?string $shipmentState=null, ?string $orderState=null, ?StateResourceIdentifier $state=null, ?CustomFieldsDraft $custom=null)