commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
All Classes Namespaces Functions Variables Pages
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
198 private $customerGroupAssignments;
199
208 public function getKey()
209 {
210 return $this->key;
211 }
212
221 public function getCustomerNumber()
222 {
223 return $this->customerNumber;
224 }
225
232 public function getExternalId()
233 {
234 return $this->externalId;
235 }
236
244 public function getEmail()
245 {
246 return $this->email;
247 }
248
256 public function getPassword()
257 {
258 return $this->password;
259 }
260
267 public function getFirstName()
268 {
269 return $this->firstName;
270 }
271
278 public function getLastName()
279 {
280 return $this->lastName;
281 }
282
289 public function getMiddleName()
290 {
291 return $this->middleName;
292 }
293
300 public function getTitle()
301 {
302 return $this->title;
303 }
304
311 public function getAnonymousCartId()
312 {
313 return $this->anonymousCartId;
314 }
315
322 public function getAnonymousCart()
323 {
324 return $this->anonymousCart instanceof CartResourceIdentifierBuilder ? $this->anonymousCart->build() : $this->anonymousCart;
325 }
326
333 public function getAnonymousId()
334 {
335 return $this->anonymousId;
336 }
337
344 public function getDateOfBirth()
345 {
346 return $this->dateOfBirth;
347 }
348
355 public function getCompanyName()
356 {
357 return $this->companyName;
358 }
359
366 public function getVatId()
367 {
368 return $this->vatId;
369 }
370
377 public function getAddresses()
378 {
379 return $this->addresses;
380 }
381
390 {
391 return $this->defaultShippingAddress;
392 }
393
401 public function getShippingAddresses()
402 {
403 return $this->shippingAddresses;
404 }
405
413 public function getDefaultBillingAddress()
414 {
415 return $this->defaultBillingAddress;
416 }
417
425 public function getBillingAddresses()
426 {
427 return $this->billingAddresses;
428 }
429
437 public function getIsEmailVerified()
438 {
439 return $this->isEmailVerified;
440 }
441
448 public function getCustomerGroup()
449 {
450 return $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup;
451 }
452
459 public function getCustom()
460 {
461 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
462 }
463
471 public function getLocale()
472 {
473 return $this->locale;
474 }
475
482 public function getSalutation()
483 {
484 return $this->salutation;
485 }
486
497 public function getStores()
498 {
499 return $this->stores;
500 }
501
511 public function getAuthenticationMode()
512 {
513 return $this->authenticationMode;
514 }
515
523 {
524 return $this->customerGroupAssignments;
525 }
526
531 public function withKey(?string $key)
532 {
533 $this->key = $key;
534
535 return $this;
536 }
537
542 public function withCustomerNumber(?string $customerNumber)
543 {
544 $this->customerNumber = $customerNumber;
545
546 return $this;
547 }
548
553 public function withExternalId(?string $externalId)
554 {
555 $this->externalId = $externalId;
556
557 return $this;
558 }
559
564 public function withEmail(?string $email)
565 {
566 $this->email = $email;
567
568 return $this;
569 }
570
575 public function withPassword(?string $password)
576 {
577 $this->password = $password;
578
579 return $this;
580 }
581
586 public function withFirstName(?string $firstName)
587 {
588 $this->firstName = $firstName;
589
590 return $this;
591 }
592
597 public function withLastName(?string $lastName)
598 {
599 $this->lastName = $lastName;
600
601 return $this;
602 }
603
608 public function withMiddleName(?string $middleName)
609 {
610 $this->middleName = $middleName;
611
612 return $this;
613 }
614
619 public function withTitle(?string $title)
620 {
621 $this->title = $title;
622
623 return $this;
624 }
625
630 public function withAnonymousCartId(?string $anonymousCartId)
631 {
632 $this->anonymousCartId = $anonymousCartId;
633
634 return $this;
635 }
636
641 public function withAnonymousCart(?CartResourceIdentifier $anonymousCart)
642 {
643 $this->anonymousCart = $anonymousCart;
644
645 return $this;
646 }
647
652 public function withAnonymousId(?string $anonymousId)
653 {
654 $this->anonymousId = $anonymousId;
655
656 return $this;
657 }
658
663 public function withDateOfBirth(?DateTimeImmutable $dateOfBirth)
664 {
665 $this->dateOfBirth = $dateOfBirth;
666
667 return $this;
668 }
669
674 public function withCompanyName(?string $companyName)
675 {
676 $this->companyName = $companyName;
677
678 return $this;
679 }
680
685 public function withVatId(?string $vatId)
686 {
687 $this->vatId = $vatId;
688
689 return $this;
690 }
691
696 public function withAddresses(?BaseAddressCollection $addresses)
697 {
698 $this->addresses = $addresses;
699
700 return $this;
701 }
702
707 public function withDefaultShippingAddress(?int $defaultShippingAddress)
708 {
709 $this->defaultShippingAddress = $defaultShippingAddress;
710
711 return $this;
712 }
713
718 public function withShippingAddresses(?array $shippingAddresses)
719 {
720 $this->shippingAddresses = $shippingAddresses;
721
722 return $this;
723 }
724
729 public function withDefaultBillingAddress(?int $defaultBillingAddress)
730 {
731 $this->defaultBillingAddress = $defaultBillingAddress;
732
733 return $this;
734 }
735
740 public function withBillingAddresses(?array $billingAddresses)
741 {
742 $this->billingAddresses = $billingAddresses;
743
744 return $this;
745 }
746
751 public function withIsEmailVerified(?bool $isEmailVerified)
752 {
753 $this->isEmailVerified = $isEmailVerified;
754
755 return $this;
756 }
757
762 public function withCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup)
763 {
764 $this->customerGroup = $customerGroup;
765
766 return $this;
767 }
768
773 public function withCustom(?CustomFieldsDraft $custom)
774 {
775 $this->custom = $custom;
776
777 return $this;
778 }
779
784 public function withLocale(?string $locale)
785 {
786 $this->locale = $locale;
787
788 return $this;
789 }
790
795 public function withSalutation(?string $salutation)
796 {
797 $this->salutation = $salutation;
798
799 return $this;
800 }
801
807 {
808 $this->stores = $stores;
809
810 return $this;
811 }
812
817 public function withAuthenticationMode(?string $authenticationMode)
818 {
819 $this->authenticationMode = $authenticationMode;
820
821 return $this;
822 }
823
829 {
830 $this->customerGroupAssignments = $customerGroupAssignments;
831
832 return $this;
833 }
834
840 {
841 $this->anonymousCart = $anonymousCart;
842
843 return $this;
844 }
845
851 {
852 $this->customerGroup = $customerGroup;
853
854 return $this;
855 }
856
862 {
863 $this->custom = $custom;
864
865 return $this;
866 }
867
868 public function build(): CustomerDraft
869 {
870 return new CustomerDraftModel(
871 $this->key,
872 $this->customerNumber,
873 $this->externalId,
874 $this->email,
875 $this->password,
876 $this->firstName,
877 $this->lastName,
878 $this->middleName,
879 $this->title,
880 $this->anonymousCartId,
881 $this->anonymousCart instanceof CartResourceIdentifierBuilder ? $this->anonymousCart->build() : $this->anonymousCart,
882 $this->anonymousId,
883 $this->dateOfBirth,
884 $this->companyName,
885 $this->vatId,
886 $this->addresses,
887 $this->defaultShippingAddress,
888 $this->shippingAddresses,
889 $this->defaultBillingAddress,
890 $this->billingAddresses,
891 $this->isEmailVerified,
892 $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup,
893 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom,
894 $this->locale,
895 $this->salutation,
896 $this->stores,
897 $this->authenticationMode,
898 $this->customerGroupAssignments
899 );
900 }
901
902 public static function of(): CustomerDraftBuilder
903 {
904 return new self();
905 }
906}
withCustomerGroupBuilder(?CustomerGroupResourceIdentifierBuilder $customerGroup)
withCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments)
withStores(?StoreResourceIdentifierCollection $stores)
withAnonymousCart(?CartResourceIdentifier $anonymousCart)
withCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup)
withAnonymousCartBuilder(?CartResourceIdentifierBuilder $anonymousCart)