commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
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 $customerGroupAssignments;
191
196 private $custom;
197
202 private $locale;
203
208 private $salutation;
209
214 private $stores;
215
220 private $authenticationMode;
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
507 {
508 return $this->customerGroupAssignments;
509 }
510
517 public function getCustom()
518 {
519 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
520 }
521
528 public function getLocale()
529 {
530 return $this->locale;
531 }
532
539 public function getSalutation()
540 {
541 return $this->salutation;
542 }
543
554 public function getStores()
555 {
556 return $this->stores;
557 }
558
565 public function getAuthenticationMode()
566 {
567 return $this->authenticationMode;
568 }
569
574 public function withId(?string $id)
575 {
576 $this->id = $id;
577
578 return $this;
579 }
580
585 public function withVersion(?int $version)
586 {
587 $this->version = $version;
588
589 return $this;
590 }
591
596 public function withCreatedAt(?DateTimeImmutable $createdAt)
597 {
598 $this->createdAt = $createdAt;
599
600 return $this;
601 }
602
607 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
608 {
609 $this->lastModifiedAt = $lastModifiedAt;
610
611 return $this;
612 }
613
618 public function withKey(?string $key)
619 {
620 $this->key = $key;
621
622 return $this;
623 }
624
629 public function withCustomerNumber(?string $customerNumber)
630 {
631 $this->customerNumber = $customerNumber;
632
633 return $this;
634 }
635
640 public function withExternalId(?string $externalId)
641 {
642 $this->externalId = $externalId;
643
644 return $this;
645 }
646
651 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
652 {
653 $this->lastModifiedBy = $lastModifiedBy;
654
655 return $this;
656 }
657
662 public function withCreatedBy(?CreatedBy $createdBy)
663 {
664 $this->createdBy = $createdBy;
665
666 return $this;
667 }
668
673 public function withEmail(?string $email)
674 {
675 $this->email = $email;
676
677 return $this;
678 }
679
684 public function withPassword(?string $password)
685 {
686 $this->password = $password;
687
688 return $this;
689 }
690
695 public function withFirstName(?string $firstName)
696 {
697 $this->firstName = $firstName;
698
699 return $this;
700 }
701
706 public function withLastName(?string $lastName)
707 {
708 $this->lastName = $lastName;
709
710 return $this;
711 }
712
717 public function withMiddleName(?string $middleName)
718 {
719 $this->middleName = $middleName;
720
721 return $this;
722 }
723
728 public function withTitle(?string $title)
729 {
730 $this->title = $title;
731
732 return $this;
733 }
734
739 public function withDateOfBirth(?DateTimeImmutable $dateOfBirth)
740 {
741 $this->dateOfBirth = $dateOfBirth;
742
743 return $this;
744 }
745
750 public function withCompanyName(?string $companyName)
751 {
752 $this->companyName = $companyName;
753
754 return $this;
755 }
756
761 public function withVatId(?string $vatId)
762 {
763 $this->vatId = $vatId;
764
765 return $this;
766 }
767
772 public function withAddresses(?AddressCollection $addresses)
773 {
774 $this->addresses = $addresses;
775
776 return $this;
777 }
778
783 public function withDefaultShippingAddressId(?string $defaultShippingAddressId)
784 {
785 $this->defaultShippingAddressId = $defaultShippingAddressId;
786
787 return $this;
788 }
789
794 public function withShippingAddressIds(?array $shippingAddressIds)
795 {
796 $this->shippingAddressIds = $shippingAddressIds;
797
798 return $this;
799 }
800
805 public function withDefaultBillingAddressId(?string $defaultBillingAddressId)
806 {
807 $this->defaultBillingAddressId = $defaultBillingAddressId;
808
809 return $this;
810 }
811
816 public function withBillingAddressIds(?array $billingAddressIds)
817 {
818 $this->billingAddressIds = $billingAddressIds;
819
820 return $this;
821 }
822
827 public function withIsEmailVerified(?bool $isEmailVerified)
828 {
829 $this->isEmailVerified = $isEmailVerified;
830
831 return $this;
832 }
833
838 public function withCustomerGroup(?CustomerGroupReference $customerGroup)
839 {
840 $this->customerGroup = $customerGroup;
841
842 return $this;
843 }
844
849 public function withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments)
850 {
851 $this->customerGroupAssignments = $customerGroupAssignments;
852
853 return $this;
854 }
855
860 public function withCustom(?CustomFields $custom)
861 {
862 $this->custom = $custom;
863
864 return $this;
865 }
866
871 public function withLocale(?string $locale)
872 {
873 $this->locale = $locale;
874
875 return $this;
876 }
877
882 public function withSalutation(?string $salutation)
883 {
884 $this->salutation = $salutation;
885
886 return $this;
887 }
888
893 public function withStores(?StoreKeyReferenceCollection $stores)
894 {
895 $this->stores = $stores;
896
897 return $this;
898 }
899
904 public function withAuthenticationMode(?string $authenticationMode)
905 {
906 $this->authenticationMode = $authenticationMode;
907
908 return $this;
909 }
910
915 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
916 {
917 $this->lastModifiedBy = $lastModifiedBy;
918
919 return $this;
920 }
921
926 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
927 {
928 $this->createdBy = $createdBy;
929
930 return $this;
931 }
932
938 {
939 $this->customerGroup = $customerGroup;
940
941 return $this;
942 }
943
948 public function withCustomBuilder(?CustomFieldsBuilder $custom)
949 {
950 $this->custom = $custom;
951
952 return $this;
953 }
954
955 public function build(): Customer
956 {
957 return new CustomerModel(
958 $this->id,
959 $this->version,
960 $this->createdAt,
961 $this->lastModifiedAt,
962 $this->key,
963 $this->customerNumber,
964 $this->externalId,
965 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
966 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
967 $this->email,
968 $this->password,
969 $this->firstName,
970 $this->lastName,
971 $this->middleName,
972 $this->title,
973 $this->dateOfBirth,
974 $this->companyName,
975 $this->vatId,
976 $this->addresses,
977 $this->defaultShippingAddressId,
978 $this->shippingAddressIds,
979 $this->defaultBillingAddressId,
980 $this->billingAddressIds,
981 $this->isEmailVerified,
982 $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
983 $this->customerGroupAssignments,
984 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
985 $this->locale,
986 $this->salutation,
987 $this->stores,
988 $this->authenticationMode
989 );
990 }
991
992 public static function of(): CustomerBuilder
993 {
994 return new self();
995 }
996}
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)