commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CustomerDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
24use DateTimeImmutable;
25use stdClass;
26
30final class CustomerDraftBuilder implements Builder
31{
36 private $key;
37
42 private $customerNumber;
43
48 private $externalId;
49
54 private $email;
55
60 private $password;
61
66 private $firstName;
67
72 private $lastName;
73
78 private $middleName;
79
84 private $title;
85
90 private $anonymousCartId;
91
96 private $anonymousCart;
97
102 private $anonymousId;
103
108 private $dateOfBirth;
109
114 private $companyName;
115
120 private $vatId;
121
126 private $addresses;
127
132 private $defaultShippingAddress;
133
138 private $shippingAddresses;
139
144 private $defaultBillingAddress;
145
150 private $billingAddresses;
151
156 private $isEmailVerified;
157
162 private $customerGroup;
163
168 private $custom;
169
174 private $locale;
175
180 private $salutation;
181
186 private $stores;
187
192 private $authenticationMode;
193
202 public function getKey()
203 {
204 return $this->key;
205 }
206
215 public function getCustomerNumber()
216 {
217 return $this->customerNumber;
218 }
219
226 public function getExternalId()
227 {
228 return $this->externalId;
229 }
230
238 public function getEmail()
239 {
240 return $this->email;
241 }
242
250 public function getPassword()
251 {
252 return $this->password;
253 }
254
261 public function getFirstName()
262 {
263 return $this->firstName;
264 }
265
272 public function getLastName()
273 {
274 return $this->lastName;
275 }
276
283 public function getMiddleName()
284 {
285 return $this->middleName;
286 }
287
294 public function getTitle()
295 {
296 return $this->title;
297 }
298
305 public function getAnonymousCartId()
306 {
307 return $this->anonymousCartId;
308 }
309
316 public function getAnonymousCart()
317 {
318 return $this->anonymousCart instanceof CartResourceIdentifierBuilder ? $this->anonymousCart->build() : $this->anonymousCart;
319 }
320
327 public function getAnonymousId()
328 {
329 return $this->anonymousId;
330 }
331
338 public function getDateOfBirth()
339 {
340 return $this->dateOfBirth;
341 }
342
349 public function getCompanyName()
350 {
351 return $this->companyName;
352 }
353
360 public function getVatId()
361 {
362 return $this->vatId;
363 }
364
371 public function getAddresses()
372 {
373 return $this->addresses;
374 }
375
384 {
385 return $this->defaultShippingAddress;
386 }
387
395 public function getShippingAddresses()
396 {
397 return $this->shippingAddresses;
398 }
399
407 public function getDefaultBillingAddress()
408 {
409 return $this->defaultBillingAddress;
410 }
411
419 public function getBillingAddresses()
420 {
421 return $this->billingAddresses;
422 }
423
431 public function getIsEmailVerified()
432 {
433 return $this->isEmailVerified;
434 }
435
442 public function getCustomerGroup()
443 {
444 return $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup;
445 }
446
453 public function getCustom()
454 {
455 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
456 }
457
465 public function getLocale()
466 {
467 return $this->locale;
468 }
469
476 public function getSalutation()
477 {
478 return $this->salutation;
479 }
480
491 public function getStores()
492 {
493 return $this->stores;
494 }
495
505 public function getAuthenticationMode()
506 {
507 return $this->authenticationMode;
508 }
509
514 public function withKey(?string $key)
515 {
516 $this->key = $key;
517
518 return $this;
519 }
520
525 public function withCustomerNumber(?string $customerNumber)
526 {
527 $this->customerNumber = $customerNumber;
528
529 return $this;
530 }
531
536 public function withExternalId(?string $externalId)
537 {
538 $this->externalId = $externalId;
539
540 return $this;
541 }
542
547 public function withEmail(?string $email)
548 {
549 $this->email = $email;
550
551 return $this;
552 }
553
558 public function withPassword(?string $password)
559 {
560 $this->password = $password;
561
562 return $this;
563 }
564
569 public function withFirstName(?string $firstName)
570 {
571 $this->firstName = $firstName;
572
573 return $this;
574 }
575
580 public function withLastName(?string $lastName)
581 {
582 $this->lastName = $lastName;
583
584 return $this;
585 }
586
591 public function withMiddleName(?string $middleName)
592 {
593 $this->middleName = $middleName;
594
595 return $this;
596 }
597
602 public function withTitle(?string $title)
603 {
604 $this->title = $title;
605
606 return $this;
607 }
608
613 public function withAnonymousCartId(?string $anonymousCartId)
614 {
615 $this->anonymousCartId = $anonymousCartId;
616
617 return $this;
618 }
619
624 public function withAnonymousCart(?CartResourceIdentifier $anonymousCart)
625 {
626 $this->anonymousCart = $anonymousCart;
627
628 return $this;
629 }
630
635 public function withAnonymousId(?string $anonymousId)
636 {
637 $this->anonymousId = $anonymousId;
638
639 return $this;
640 }
641
646 public function withDateOfBirth(?DateTimeImmutable $dateOfBirth)
647 {
648 $this->dateOfBirth = $dateOfBirth;
649
650 return $this;
651 }
652
657 public function withCompanyName(?string $companyName)
658 {
659 $this->companyName = $companyName;
660
661 return $this;
662 }
663
668 public function withVatId(?string $vatId)
669 {
670 $this->vatId = $vatId;
671
672 return $this;
673 }
674
679 public function withAddresses(?BaseAddressCollection $addresses)
680 {
681 $this->addresses = $addresses;
682
683 return $this;
684 }
685
690 public function withDefaultShippingAddress(?int $defaultShippingAddress)
691 {
692 $this->defaultShippingAddress = $defaultShippingAddress;
693
694 return $this;
695 }
696
701 public function withShippingAddresses(?array $shippingAddresses)
702 {
703 $this->shippingAddresses = $shippingAddresses;
704
705 return $this;
706 }
707
712 public function withDefaultBillingAddress(?int $defaultBillingAddress)
713 {
714 $this->defaultBillingAddress = $defaultBillingAddress;
715
716 return $this;
717 }
718
723 public function withBillingAddresses(?array $billingAddresses)
724 {
725 $this->billingAddresses = $billingAddresses;
726
727 return $this;
728 }
729
734 public function withIsEmailVerified(?bool $isEmailVerified)
735 {
736 $this->isEmailVerified = $isEmailVerified;
737
738 return $this;
739 }
740
745 public function withCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup)
746 {
747 $this->customerGroup = $customerGroup;
748
749 return $this;
750 }
751
756 public function withCustom(?CustomFieldsDraft $custom)
757 {
758 $this->custom = $custom;
759
760 return $this;
761 }
762
767 public function withLocale(?string $locale)
768 {
769 $this->locale = $locale;
770
771 return $this;
772 }
773
778 public function withSalutation(?string $salutation)
779 {
780 $this->salutation = $salutation;
781
782 return $this;
783 }
784
790 {
791 $this->stores = $stores;
792
793 return $this;
794 }
795
800 public function withAuthenticationMode(?string $authenticationMode)
801 {
802 $this->authenticationMode = $authenticationMode;
803
804 return $this;
805 }
806
812 {
813 $this->anonymousCart = $anonymousCart;
814
815 return $this;
816 }
817
823 {
824 $this->customerGroup = $customerGroup;
825
826 return $this;
827 }
828
834 {
835 $this->custom = $custom;
836
837 return $this;
838 }
839
840 public function build(): CustomerDraft
841 {
842 return new CustomerDraftModel(
843 $this->key,
844 $this->customerNumber,
845 $this->externalId,
846 $this->email,
847 $this->password,
848 $this->firstName,
849 $this->lastName,
850 $this->middleName,
851 $this->title,
852 $this->anonymousCartId,
853 $this->anonymousCart instanceof CartResourceIdentifierBuilder ? $this->anonymousCart->build() : $this->anonymousCart,
854 $this->anonymousId,
855 $this->dateOfBirth,
856 $this->companyName,
857 $this->vatId,
858 $this->addresses,
859 $this->defaultShippingAddress,
860 $this->shippingAddresses,
861 $this->defaultBillingAddress,
862 $this->billingAddresses,
863 $this->isEmailVerified,
864 $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup,
865 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom,
866 $this->locale,
867 $this->salutation,
868 $this->stores,
869 $this->authenticationMode
870 );
871 }
872
873 public static function of(): CustomerDraftBuilder
874 {
875 return new self();
876 }
877}
withCustomerGroupBuilder(?CustomerGroupResourceIdentifierBuilder $customerGroup)
withStores(?StoreResourceIdentifierCollection $stores)
withAnonymousCart(?CartResourceIdentifier $anonymousCart)
withCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup)
withAnonymousCartBuilder(?CartResourceIdentifierBuilder $anonymousCart)