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 $customerGroupAssignments;
169
174 private $custom;
175
180 private $locale;
181
186 private $salutation;
187
192 private $stores;
193
198 private $authenticationMode;
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
334 public function getAnonymousId()
335 {
336 return $this->anonymousId;
337 }
338
345 public function getDateOfBirth()
346 {
347 return $this->dateOfBirth;
348 }
349
356 public function getCompanyName()
357 {
358 return $this->companyName;
359 }
360
367 public function getVatId()
368 {
369 return $this->vatId;
370 }
371
378 public function getAddresses()
379 {
380 return $this->addresses;
381 }
382
391 {
392 return $this->defaultShippingAddress;
393 }
394
402 public function getShippingAddresses()
403 {
404 return $this->shippingAddresses;
405 }
406
414 public function getDefaultBillingAddress()
415 {
416 return $this->defaultBillingAddress;
417 }
418
426 public function getBillingAddresses()
427 {
428 return $this->billingAddresses;
429 }
430
438 public function getIsEmailVerified()
439 {
440 return $this->isEmailVerified;
441 }
442
450 public function getCustomerGroup()
451 {
452 return $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup;
453 }
454
463 {
464 return $this->customerGroupAssignments;
465 }
466
473 public function getCustom()
474 {
475 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
476 }
477
485 public function getLocale()
486 {
487 return $this->locale;
488 }
489
496 public function getSalutation()
497 {
498 return $this->salutation;
499 }
500
511 public function getStores()
512 {
513 return $this->stores;
514 }
515
525 public function getAuthenticationMode()
526 {
527 return $this->authenticationMode;
528 }
529
534 public function withKey(?string $key)
535 {
536 $this->key = $key;
537
538 return $this;
539 }
540
545 public function withCustomerNumber(?string $customerNumber)
546 {
547 $this->customerNumber = $customerNumber;
548
549 return $this;
550 }
551
556 public function withExternalId(?string $externalId)
557 {
558 $this->externalId = $externalId;
559
560 return $this;
561 }
562
567 public function withEmail(?string $email)
568 {
569 $this->email = $email;
570
571 return $this;
572 }
573
578 public function withPassword(?string $password)
579 {
580 $this->password = $password;
581
582 return $this;
583 }
584
589 public function withFirstName(?string $firstName)
590 {
591 $this->firstName = $firstName;
592
593 return $this;
594 }
595
600 public function withLastName(?string $lastName)
601 {
602 $this->lastName = $lastName;
603
604 return $this;
605 }
606
611 public function withMiddleName(?string $middleName)
612 {
613 $this->middleName = $middleName;
614
615 return $this;
616 }
617
622 public function withTitle(?string $title)
623 {
624 $this->title = $title;
625
626 return $this;
627 }
628
633 public function withAnonymousCartId(?string $anonymousCartId)
634 {
635 $this->anonymousCartId = $anonymousCartId;
636
637 return $this;
638 }
639
644 public function withAnonymousCart(?CartResourceIdentifier $anonymousCart)
645 {
646 $this->anonymousCart = $anonymousCart;
647
648 return $this;
649 }
650
655 public function withAnonymousId(?string $anonymousId)
656 {
657 $this->anonymousId = $anonymousId;
658
659 return $this;
660 }
661
666 public function withDateOfBirth(?DateTimeImmutable $dateOfBirth)
667 {
668 $this->dateOfBirth = $dateOfBirth;
669
670 return $this;
671 }
672
677 public function withCompanyName(?string $companyName)
678 {
679 $this->companyName = $companyName;
680
681 return $this;
682 }
683
688 public function withVatId(?string $vatId)
689 {
690 $this->vatId = $vatId;
691
692 return $this;
693 }
694
699 public function withAddresses(?BaseAddressCollection $addresses)
700 {
701 $this->addresses = $addresses;
702
703 return $this;
704 }
705
710 public function withDefaultShippingAddress(?int $defaultShippingAddress)
711 {
712 $this->defaultShippingAddress = $defaultShippingAddress;
713
714 return $this;
715 }
716
721 public function withShippingAddresses(?array $shippingAddresses)
722 {
723 $this->shippingAddresses = $shippingAddresses;
724
725 return $this;
726 }
727
732 public function withDefaultBillingAddress(?int $defaultBillingAddress)
733 {
734 $this->defaultBillingAddress = $defaultBillingAddress;
735
736 return $this;
737 }
738
743 public function withBillingAddresses(?array $billingAddresses)
744 {
745 $this->billingAddresses = $billingAddresses;
746
747 return $this;
748 }
749
754 public function withIsEmailVerified(?bool $isEmailVerified)
755 {
756 $this->isEmailVerified = $isEmailVerified;
757
758 return $this;
759 }
760
765 public function withCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup)
766 {
767 $this->customerGroup = $customerGroup;
768
769 return $this;
770 }
771
777 {
778 $this->customerGroupAssignments = $customerGroupAssignments;
779
780 return $this;
781 }
782
787 public function withCustom(?CustomFieldsDraft $custom)
788 {
789 $this->custom = $custom;
790
791 return $this;
792 }
793
798 public function withLocale(?string $locale)
799 {
800 $this->locale = $locale;
801
802 return $this;
803 }
804
809 public function withSalutation(?string $salutation)
810 {
811 $this->salutation = $salutation;
812
813 return $this;
814 }
815
821 {
822 $this->stores = $stores;
823
824 return $this;
825 }
826
831 public function withAuthenticationMode(?string $authenticationMode)
832 {
833 $this->authenticationMode = $authenticationMode;
834
835 return $this;
836 }
837
843 {
844 $this->anonymousCart = $anonymousCart;
845
846 return $this;
847 }
848
854 {
855 $this->customerGroup = $customerGroup;
856
857 return $this;
858 }
859
865 {
866 $this->custom = $custom;
867
868 return $this;
869 }
870
871 public function build(): CustomerDraft
872 {
873 return new CustomerDraftModel(
874 $this->key,
875 $this->customerNumber,
876 $this->externalId,
877 $this->email,
878 $this->password,
879 $this->firstName,
880 $this->lastName,
881 $this->middleName,
882 $this->title,
883 $this->anonymousCartId,
884 $this->anonymousCart instanceof CartResourceIdentifierBuilder ? $this->anonymousCart->build() : $this->anonymousCart,
885 $this->anonymousId,
886 $this->dateOfBirth,
887 $this->companyName,
888 $this->vatId,
889 $this->addresses,
890 $this->defaultShippingAddress,
891 $this->shippingAddresses,
892 $this->defaultBillingAddress,
893 $this->billingAddresses,
894 $this->isEmailVerified,
895 $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup,
896 $this->customerGroupAssignments,
897 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom,
898 $this->locale,
899 $this->salutation,
900 $this->stores,
901 $this->authenticationMode
902 );
903 }
904
905 public static function of(): CustomerDraftBuilder
906 {
907 return new self();
908 }
909}
withCustomerGroupBuilder(?CustomerGroupResourceIdentifierBuilder $customerGroup)
withCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments)
withStores(?StoreResourceIdentifierCollection $stores)
withAnonymousCart(?CartResourceIdentifier $anonymousCart)
withCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup)
withAnonymousCartBuilder(?CartResourceIdentifierBuilder $anonymousCart)