commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
All Classes Namespaces Functions Variables Pages
CustomerBuilder.php
1<?php
2
3declare(strict_types=1);
10
28use DateTimeImmutable;
29use stdClass;
30
34final class CustomerBuilder implements Builder
35{
40 private $id;
41
46 private $version;
47
52 private $createdAt;
53
58 private $lastModifiedAt;
59
64 private $key;
65
70 private $customerNumber;
71
76 private $externalId;
77
82 private $lastModifiedBy;
83
88 private $createdBy;
89
94 private $email;
95
100 private $password;
101
106 private $firstName;
107
112 private $lastName;
113
118 private $middleName;
119
124 private $title;
125
130 private $dateOfBirth;
131
136 private $companyName;
137
142 private $vatId;
143
148 private $addresses;
149
154 private $defaultShippingAddressId;
155
160 private $shippingAddressIds;
161
166 private $defaultBillingAddressId;
167
172 private $billingAddressIds;
173
178 private $isEmailVerified;
179
184 private $customerGroup;
185
190 private $custom;
191
196 private $locale;
197
202 private $salutation;
203
208 private $stores;
209
214 private $authenticationMode;
215
220 private $customerGroupAssignments;
221
228 public function getId()
229 {
230 return $this->id;
231 }
232
239 public function getVersion()
240 {
241 return $this->version;
242 }
243
250 public function getCreatedAt()
251 {
252 return $this->createdAt;
253 }
254
261 public function getLastModifiedAt()
262 {
263 return $this->lastModifiedAt;
264 }
265
272 public function getKey()
273 {
274 return $this->key;
275 }
276
284 public function getCustomerNumber()
285 {
286 return $this->customerNumber;
287 }
288
295 public function getExternalId()
296 {
297 return $this->externalId;
298 }
299
306 public function getLastModifiedBy()
307 {
308 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
309 }
310
317 public function getCreatedBy()
318 {
319 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
320 }
321
329 public function getEmail()
330 {
331 return $this->email;
332 }
333
340 public function getPassword()
341 {
342 return $this->password;
343 }
344
351 public function getFirstName()
352 {
353 return $this->firstName;
354 }
355
362 public function getLastName()
363 {
364 return $this->lastName;
365 }
366
373 public function getMiddleName()
374 {
375 return $this->middleName;
376 }
377
384 public function getTitle()
385 {
386 return $this->title;
387 }
388
395 public function getDateOfBirth()
396 {
397 return $this->dateOfBirth;
398 }
399
406 public function getCompanyName()
407 {
408 return $this->companyName;
409 }
410
417 public function getVatId()
418 {
419 return $this->vatId;
420 }
421
428 public function getAddresses()
429 {
430 return $this->addresses;
431 }
432
440 {
441 return $this->defaultShippingAddressId;
442 }
443
450 public function getShippingAddressIds()
451 {
452 return $this->shippingAddressIds;
453 }
454
462 {
463 return $this->defaultBillingAddressId;
464 }
465
472 public function getBillingAddressIds()
473 {
474 return $this->billingAddressIds;
475 }
476
483 public function getIsEmailVerified()
484 {
485 return $this->isEmailVerified;
486 }
487
494 public function getCustomerGroup()
495 {
496 return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup;
497 }
498
505 public function getCustom()
506 {
507 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
508 }
509
516 public function getLocale()
517 {
518 return $this->locale;
519 }
520
527 public function getSalutation()
528 {
529 return $this->salutation;
530 }
531
542 public function getStores()
543 {
544 return $this->stores;
545 }
546
553 public function getAuthenticationMode()
554 {
555 return $this->authenticationMode;
556 }
557
565 {
566 return $this->customerGroupAssignments;
567 }
568
573 public function withId(?string $id)
574 {
575 $this->id = $id;
576
577 return $this;
578 }
579
584 public function withVersion(?int $version)
585 {
586 $this->version = $version;
587
588 return $this;
589 }
590
595 public function withCreatedAt(?DateTimeImmutable $createdAt)
596 {
597 $this->createdAt = $createdAt;
598
599 return $this;
600 }
601
606 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
607 {
608 $this->lastModifiedAt = $lastModifiedAt;
609
610 return $this;
611 }
612
617 public function withKey(?string $key)
618 {
619 $this->key = $key;
620
621 return $this;
622 }
623
628 public function withCustomerNumber(?string $customerNumber)
629 {
630 $this->customerNumber = $customerNumber;
631
632 return $this;
633 }
634
639 public function withExternalId(?string $externalId)
640 {
641 $this->externalId = $externalId;
642
643 return $this;
644 }
645
650 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
651 {
652 $this->lastModifiedBy = $lastModifiedBy;
653
654 return $this;
655 }
656
661 public function withCreatedBy(?CreatedBy $createdBy)
662 {
663 $this->createdBy = $createdBy;
664
665 return $this;
666 }
667
672 public function withEmail(?string $email)
673 {
674 $this->email = $email;
675
676 return $this;
677 }
678
683 public function withPassword(?string $password)
684 {
685 $this->password = $password;
686
687 return $this;
688 }
689
694 public function withFirstName(?string $firstName)
695 {
696 $this->firstName = $firstName;
697
698 return $this;
699 }
700
705 public function withLastName(?string $lastName)
706 {
707 $this->lastName = $lastName;
708
709 return $this;
710 }
711
716 public function withMiddleName(?string $middleName)
717 {
718 $this->middleName = $middleName;
719
720 return $this;
721 }
722
727 public function withTitle(?string $title)
728 {
729 $this->title = $title;
730
731 return $this;
732 }
733
738 public function withDateOfBirth(?DateTimeImmutable $dateOfBirth)
739 {
740 $this->dateOfBirth = $dateOfBirth;
741
742 return $this;
743 }
744
749 public function withCompanyName(?string $companyName)
750 {
751 $this->companyName = $companyName;
752
753 return $this;
754 }
755
760 public function withVatId(?string $vatId)
761 {
762 $this->vatId = $vatId;
763
764 return $this;
765 }
766
771 public function withAddresses(?AddressCollection $addresses)
772 {
773 $this->addresses = $addresses;
774
775 return $this;
776 }
777
782 public function withDefaultShippingAddressId(?string $defaultShippingAddressId)
783 {
784 $this->defaultShippingAddressId = $defaultShippingAddressId;
785
786 return $this;
787 }
788
793 public function withShippingAddressIds(?array $shippingAddressIds)
794 {
795 $this->shippingAddressIds = $shippingAddressIds;
796
797 return $this;
798 }
799
804 public function withDefaultBillingAddressId(?string $defaultBillingAddressId)
805 {
806 $this->defaultBillingAddressId = $defaultBillingAddressId;
807
808 return $this;
809 }
810
815 public function withBillingAddressIds(?array $billingAddressIds)
816 {
817 $this->billingAddressIds = $billingAddressIds;
818
819 return $this;
820 }
821
826 public function withIsEmailVerified(?bool $isEmailVerified)
827 {
828 $this->isEmailVerified = $isEmailVerified;
829
830 return $this;
831 }
832
837 public function withCustomerGroup(?CustomerGroupReference $customerGroup)
838 {
839 $this->customerGroup = $customerGroup;
840
841 return $this;
842 }
843
848 public function withCustom(?CustomFields $custom)
849 {
850 $this->custom = $custom;
851
852 return $this;
853 }
854
859 public function withLocale(?string $locale)
860 {
861 $this->locale = $locale;
862
863 return $this;
864 }
865
870 public function withSalutation(?string $salutation)
871 {
872 $this->salutation = $salutation;
873
874 return $this;
875 }
876
881 public function withStores(?StoreKeyReferenceCollection $stores)
882 {
883 $this->stores = $stores;
884
885 return $this;
886 }
887
892 public function withAuthenticationMode(?string $authenticationMode)
893 {
894 $this->authenticationMode = $authenticationMode;
895
896 return $this;
897 }
898
903 public function withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments)
904 {
905 $this->customerGroupAssignments = $customerGroupAssignments;
906
907 return $this;
908 }
909
914 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
915 {
916 $this->lastModifiedBy = $lastModifiedBy;
917
918 return $this;
919 }
920
925 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
926 {
927 $this->createdBy = $createdBy;
928
929 return $this;
930 }
931
937 {
938 $this->customerGroup = $customerGroup;
939
940 return $this;
941 }
942
947 public function withCustomBuilder(?CustomFieldsBuilder $custom)
948 {
949 $this->custom = $custom;
950
951 return $this;
952 }
953
954 public function build(): Customer
955 {
956 return new CustomerModel(
957 $this->id,
958 $this->version,
959 $this->createdAt,
960 $this->lastModifiedAt,
961 $this->key,
962 $this->customerNumber,
963 $this->externalId,
964 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
965 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
966 $this->email,
967 $this->password,
968 $this->firstName,
969 $this->lastName,
970 $this->middleName,
971 $this->title,
972 $this->dateOfBirth,
973 $this->companyName,
974 $this->vatId,
975 $this->addresses,
976 $this->defaultShippingAddressId,
977 $this->shippingAddressIds,
978 $this->defaultBillingAddressId,
979 $this->billingAddressIds,
980 $this->isEmailVerified,
981 $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
982 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
983 $this->locale,
984 $this->salutation,
985 $this->stores,
986 $this->authenticationMode,
987 $this->customerGroupAssignments
988 );
989 }
990
991 public static function of(): CustomerBuilder
992 {
993 return new self();
994 }
995}
withCustomerGroupBuilder(?CustomerGroupReferenceBuilder $customerGroup)
withDefaultShippingAddressId(?string $defaultShippingAddressId)
withDefaultBillingAddressId(?string $defaultBillingAddressId)
withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments)
withDateOfBirth(?DateTimeImmutable $dateOfBirth)
withCustomerGroup(?CustomerGroupReference $customerGroup)
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withStores(?StoreKeyReferenceCollection $stores)
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)