commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
MyCartDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
27use stdClass;
28
32final class MyCartDraftBuilder implements Builder
33{
38 private $currency;
39
44 private $customerEmail;
45
50 private $businessUnit;
51
56 private $store;
57
62 private $lineItems;
63
68 private $taxMode;
69
74 private $inventoryMode;
75
80 private $billingAddress;
81
86 private $shippingAddress;
87
92 private $shippingMethod;
93
98 private $itemShippingAddresses;
99
104 private $shippingMode;
105
110 private $discountCodes;
111
116 private $country;
117
122 private $locale;
123
128 private $deleteDaysAfterLastModification;
129
134 private $custom;
135
142 public function getCurrency()
143 {
144 return $this->currency;
145 }
146
153 public function getCustomerEmail()
154 {
155 return $this->customerEmail;
156 }
157
164 public function getBusinessUnit()
165 {
166 return $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit;
167 }
168
175 public function getStore()
176 {
177 return $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store;
178 }
179
186 public function getLineItems()
187 {
188 return $this->lineItems;
189 }
190
197 public function getTaxMode()
198 {
199 return $this->taxMode;
200 }
201
208 public function getInventoryMode()
209 {
210 return $this->inventoryMode;
211 }
212
219 public function getBillingAddress()
220 {
221 return $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress;
222 }
223
230 public function getShippingAddress()
231 {
232 return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress;
233 }
234
241 public function getShippingMethod()
242 {
243 return $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod;
244 }
245
254 public function getItemShippingAddresses()
255 {
256 return $this->itemShippingAddresses;
257 }
258
268 public function getShippingMode()
269 {
270 return $this->shippingMode;
271 }
272
279 public function getDiscountCodes()
280 {
281 return $this->discountCodes;
282 }
283
291 public function getCountry()
292 {
293 return $this->country;
294 }
295
302 public function getLocale()
303 {
304 return $this->locale;
305 }
306
316 {
317 return $this->deleteDaysAfterLastModification;
318 }
319
326 public function getCustom()
327 {
328 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
329 }
330
335 public function withCurrency(?string $currency)
336 {
337 $this->currency = $currency;
338
339 return $this;
340 }
341
346 public function withCustomerEmail(?string $customerEmail)
347 {
348 $this->customerEmail = $customerEmail;
349
350 return $this;
351 }
352
357 public function withBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit)
358 {
359 $this->businessUnit = $businessUnit;
360
361 return $this;
362 }
363
368 public function withStore(?StoreResourceIdentifier $store)
369 {
370 $this->store = $store;
371
372 return $this;
373 }
374
379 public function withLineItems(?MyLineItemDraftCollection $lineItems)
380 {
381 $this->lineItems = $lineItems;
382
383 return $this;
384 }
385
390 public function withTaxMode(?string $taxMode)
391 {
392 $this->taxMode = $taxMode;
393
394 return $this;
395 }
396
401 public function withInventoryMode(?string $inventoryMode)
402 {
403 $this->inventoryMode = $inventoryMode;
404
405 return $this;
406 }
407
412 public function withBillingAddress(?BaseAddress $billingAddress)
413 {
414 $this->billingAddress = $billingAddress;
415
416 return $this;
417 }
418
423 public function withShippingAddress(?BaseAddress $shippingAddress)
424 {
425 $this->shippingAddress = $shippingAddress;
426
427 return $this;
428 }
429
434 public function withShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod)
435 {
436 $this->shippingMethod = $shippingMethod;
437
438 return $this;
439 }
440
445 public function withItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses)
446 {
447 $this->itemShippingAddresses = $itemShippingAddresses;
448
449 return $this;
450 }
451
456 public function withShippingMode(?string $shippingMode)
457 {
458 $this->shippingMode = $shippingMode;
459
460 return $this;
461 }
462
467 public function withDiscountCodes(?array $discountCodes)
468 {
469 $this->discountCodes = $discountCodes;
470
471 return $this;
472 }
473
478 public function withCountry(?string $country)
479 {
480 $this->country = $country;
481
482 return $this;
483 }
484
489 public function withLocale(?string $locale)
490 {
491 $this->locale = $locale;
492
493 return $this;
494 }
495
500 public function withDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification)
501 {
502 $this->deleteDaysAfterLastModification = $deleteDaysAfterLastModification;
503
504 return $this;
505 }
506
511 public function withCustom(?CustomFieldsDraft $custom)
512 {
513 $this->custom = $custom;
514
515 return $this;
516 }
517
523 {
524 $this->businessUnit = $businessUnit;
525
526 return $this;
527 }
528
534 {
535 $this->store = $store;
536
537 return $this;
538 }
539
544 public function withBillingAddressBuilder(?BaseAddressBuilder $billingAddress)
545 {
546 $this->billingAddress = $billingAddress;
547
548 return $this;
549 }
550
555 public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress)
556 {
557 $this->shippingAddress = $shippingAddress;
558
559 return $this;
560 }
561
567 {
568 $this->shippingMethod = $shippingMethod;
569
570 return $this;
571 }
572
578 {
579 $this->custom = $custom;
580
581 return $this;
582 }
583
584 public function build(): MyCartDraft
585 {
586 return new MyCartDraftModel(
587 $this->currency,
588 $this->customerEmail,
589 $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit,
590 $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store,
591 $this->lineItems,
592 $this->taxMode,
593 $this->inventoryMode,
594 $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress,
595 $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress,
596 $this->shippingMethod instanceof ShippingMethodResourceIdentifierBuilder ? $this->shippingMethod->build() : $this->shippingMethod,
597 $this->itemShippingAddresses,
598 $this->shippingMode,
599 $this->discountCodes,
600 $this->country,
601 $this->locale,
602 $this->deleteDaysAfterLastModification,
603 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
604 );
605 }
606
607 public static function of(): MyCartDraftBuilder
608 {
609 return new self();
610 }
611}
withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress)
withBusinessUnitBuilder(?BusinessUnitResourceIdentifierBuilder $businessUnit)
withShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod)
withBillingAddressBuilder(?BaseAddressBuilder $billingAddress)
withStoreBuilder(?StoreResourceIdentifierBuilder $store)
withLineItems(?MyLineItemDraftCollection $lineItems)
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
withBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit)
withDeleteDaysAfterLastModification(?int $deleteDaysAfterLastModification)
withItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses)
withShippingMethodBuilder(?ShippingMethodResourceIdentifierBuilder $shippingMethod)