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
206 public function getPurchaseOrderNumber()
207 {
208 if (is_null($this->purchaseOrderNumber)) {
210 $data = $this->raw(self::FIELD_PURCHASE_ORDER_NUMBER);
211 if (is_null($data)) {
212 return null;
213 }
214 $this->purchaseOrderNumber = (string) $data;
215 }
216
218 }
219
226 public function getPaymentState()
227 {
228 if (is_null($this->paymentState)) {
230 $data = $this->raw(self::FIELD_PAYMENT_STATE);
231 if (is_null($data)) {
232 return null;
233 }
234 $this->paymentState = (string) $data;
235 }
236
237 return $this->paymentState;
238 }
239
246 public function getShipmentState()
247 {
248 if (is_null($this->shipmentState)) {
250 $data = $this->raw(self::FIELD_SHIPMENT_STATE);
251 if (is_null($data)) {
252 return null;
253 }
254 $this->shipmentState = (string) $data;
255 }
256
258 }
259
266 public function getOrderState()
267 {
268 if (is_null($this->orderState)) {
270 $data = $this->raw(self::FIELD_ORDER_STATE);
271 if (is_null($data)) {
272 return null;
273 }
274 $this->orderState = (string) $data;
275 }
276
277 return $this->orderState;
278 }
279
286 public function getState()
287 {
288 if (is_null($this->state)) {
290 $data = $this->raw(self::FIELD_STATE);
291 if (is_null($data)) {
292 return null;
293 }
294
295 $this->state = StateResourceIdentifierModel::of($data);
296 }
297
298 return $this->state;
299 }
300
312 public function getCustom()
313 {
314 if (is_null($this->custom)) {
316 $data = $this->raw(self::FIELD_CUSTOM);
317 if (is_null($data)) {
318 return null;
319 }
320
321 $this->custom = CustomFieldsDraftModel::of($data);
322 }
323
324 return $this->custom;
325 }
326
327
331 public function setId(?string $id): void
332 {
333 $this->id = $id;
334 }
335
339 public function setCart(?CartResourceIdentifier $cart): void
340 {
341 $this->cart = $cart;
342 }
343
347 public function setVersion(?int $version): void
348 {
349 $this->version = $version;
350 }
351
355 public function setOrderNumber(?string $orderNumber): void
356 {
357 $this->orderNumber = $orderNumber;
358 }
359
363 public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void
364 {
365 $this->purchaseOrderNumber = $purchaseOrderNumber;
366 }
367
371 public function setPaymentState(?string $paymentState): void
372 {
373 $this->paymentState = $paymentState;
374 }
375
379 public function setShipmentState(?string $shipmentState): void
380 {
381 $this->shipmentState = $shipmentState;
382 }
383
387 public function setOrderState(?string $orderState): void
388 {
389 $this->orderState = $orderState;
390 }
391
396 {
397 $this->state = $state;
398 }
399
403 public function setCustom(?CustomFieldsDraft $custom): void
404 {
405 $this->custom = $custom;
406 }
407}
__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)