commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
BusinessUnitBuilder.php
1<?php
2
3declare(strict_types=1);
10
27use DateTimeImmutable;
28use stdClass;
29
33final class BusinessUnitBuilder implements Builder
34{
39 private $id;
40
45 private $version;
46
51 private $createdAt;
52
57 private $lastModifiedAt;
58
63 private $lastModifiedBy;
64
69 private $createdBy;
70
75 private $key;
76
81 private $status;
82
87 private $stores;
88
93 private $inheritedStores;
94
99 private $storeMode;
100
105 private $name;
106
111 private $contactEmail;
112
117 private $custom;
118
123 private $customerGroupAssignments;
124
129 private $addresses;
130
135 private $shippingAddressIds;
136
141 private $defaultShippingAddressId;
142
147 private $billingAddressIds;
148
153 private $defaultBillingAddressId;
154
159 private $associateMode;
160
165 private $associates;
166
171 private $inheritedAssociates;
172
177 private $parentUnit;
178
183 private $topLevelUnit;
184
189 private $approvalRuleMode;
190
197 public function getId()
198 {
199 return $this->id;
200 }
201
208 public function getVersion()
209 {
210 return $this->version;
211 }
212
219 public function getCreatedAt()
220 {
221 return $this->createdAt;
222 }
223
230 public function getLastModifiedAt()
231 {
232 return $this->lastModifiedAt;
233 }
234
241 public function getLastModifiedBy()
242 {
243 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
244 }
245
252 public function getCreatedBy()
253 {
254 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
255 }
256
263 public function getKey()
264 {
265 return $this->key;
266 }
267
274 public function getStatus()
275 {
276 return $this->status;
277 }
278
287 public function getStores()
288 {
289 return $this->stores;
290 }
291
298 public function getInheritedStores()
299 {
300 return $this->inheritedStores;
301 }
302
309 public function getStoreMode()
310 {
311 return $this->storeMode;
312 }
313
320 public function getName()
321 {
322 return $this->name;
323 }
324
331 public function getContactEmail()
332 {
333 return $this->contactEmail;
334 }
335
342 public function getCustom()
343 {
344 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
345 }
346
355 {
356 return $this->customerGroupAssignments;
357 }
358
365 public function getAddresses()
366 {
367 return $this->addresses;
368 }
369
376 public function getShippingAddressIds()
377 {
378 return $this->shippingAddressIds;
379 }
380
388 {
389 return $this->defaultShippingAddressId;
390 }
391
398 public function getBillingAddressIds()
399 {
400 return $this->billingAddressIds;
401 }
402
410 {
411 return $this->defaultBillingAddressId;
412 }
413
420 public function getAssociateMode()
421 {
422 return $this->associateMode;
423 }
424
431 public function getAssociates()
432 {
433 return $this->associates;
434 }
435
442 public function getInheritedAssociates()
443 {
444 return $this->inheritedAssociates;
445 }
446
453 public function getParentUnit()
454 {
455 return $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit;
456 }
457
464 public function getTopLevelUnit()
465 {
466 return $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit;
467 }
468
476 public function getApprovalRuleMode()
477 {
478 return $this->approvalRuleMode;
479 }
480
485 public function withId(?string $id)
486 {
487 $this->id = $id;
488
489 return $this;
490 }
491
496 public function withVersion(?int $version)
497 {
498 $this->version = $version;
499
500 return $this;
501 }
502
507 public function withCreatedAt(?DateTimeImmutable $createdAt)
508 {
509 $this->createdAt = $createdAt;
510
511 return $this;
512 }
513
518 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
519 {
520 $this->lastModifiedAt = $lastModifiedAt;
521
522 return $this;
523 }
524
529 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
530 {
531 $this->lastModifiedBy = $lastModifiedBy;
532
533 return $this;
534 }
535
540 public function withCreatedBy(?CreatedBy $createdBy)
541 {
542 $this->createdBy = $createdBy;
543
544 return $this;
545 }
546
551 public function withKey(?string $key)
552 {
553 $this->key = $key;
554
555 return $this;
556 }
557
562 public function withStatus(?string $status)
563 {
564 $this->status = $status;
565
566 return $this;
567 }
568
573 public function withStores(?StoreKeyReferenceCollection $stores)
574 {
575 $this->stores = $stores;
576
577 return $this;
578 }
579
584 public function withInheritedStores(?StoreKeyReferenceCollection $inheritedStores)
585 {
586 $this->inheritedStores = $inheritedStores;
587
588 return $this;
589 }
590
595 public function withStoreMode(?string $storeMode)
596 {
597 $this->storeMode = $storeMode;
598
599 return $this;
600 }
601
606 public function withName(?string $name)
607 {
608 $this->name = $name;
609
610 return $this;
611 }
612
617 public function withContactEmail(?string $contactEmail)
618 {
619 $this->contactEmail = $contactEmail;
620
621 return $this;
622 }
623
628 public function withCustom(?CustomFields $custom)
629 {
630 $this->custom = $custom;
631
632 return $this;
633 }
634
639 public function withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments)
640 {
641 $this->customerGroupAssignments = $customerGroupAssignments;
642
643 return $this;
644 }
645
650 public function withAddresses(?AddressCollection $addresses)
651 {
652 $this->addresses = $addresses;
653
654 return $this;
655 }
656
661 public function withShippingAddressIds(?array $shippingAddressIds)
662 {
663 $this->shippingAddressIds = $shippingAddressIds;
664
665 return $this;
666 }
667
672 public function withDefaultShippingAddressId(?string $defaultShippingAddressId)
673 {
674 $this->defaultShippingAddressId = $defaultShippingAddressId;
675
676 return $this;
677 }
678
683 public function withBillingAddressIds(?array $billingAddressIds)
684 {
685 $this->billingAddressIds = $billingAddressIds;
686
687 return $this;
688 }
689
694 public function withDefaultBillingAddressId(?string $defaultBillingAddressId)
695 {
696 $this->defaultBillingAddressId = $defaultBillingAddressId;
697
698 return $this;
699 }
700
705 public function withAssociateMode(?string $associateMode)
706 {
707 $this->associateMode = $associateMode;
708
709 return $this;
710 }
711
716 public function withAssociates(?AssociateCollection $associates)
717 {
718 $this->associates = $associates;
719
720 return $this;
721 }
722
727 public function withInheritedAssociates(?InheritedAssociateCollection $inheritedAssociates)
728 {
729 $this->inheritedAssociates = $inheritedAssociates;
730
731 return $this;
732 }
733
738 public function withParentUnit(?BusinessUnitKeyReference $parentUnit)
739 {
740 $this->parentUnit = $parentUnit;
741
742 return $this;
743 }
744
749 public function withTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit)
750 {
751 $this->topLevelUnit = $topLevelUnit;
752
753 return $this;
754 }
755
760 public function withApprovalRuleMode(?string $approvalRuleMode)
761 {
762 $this->approvalRuleMode = $approvalRuleMode;
763
764 return $this;
765 }
766
771 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
772 {
773 $this->lastModifiedBy = $lastModifiedBy;
774
775 return $this;
776 }
777
782 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
783 {
784 $this->createdBy = $createdBy;
785
786 return $this;
787 }
788
793 public function withCustomBuilder(?CustomFieldsBuilder $custom)
794 {
795 $this->custom = $custom;
796
797 return $this;
798 }
799
805 {
806 $this->parentUnit = $parentUnit;
807
808 return $this;
809 }
810
816 {
817 $this->topLevelUnit = $topLevelUnit;
818
819 return $this;
820 }
821
822 public function build(): BusinessUnit
823 {
824 return new BusinessUnitModel(
825 $this->id,
826 $this->version,
827 $this->createdAt,
828 $this->lastModifiedAt,
829 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
830 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
831 $this->key,
832 $this->status,
833 $this->stores,
834 $this->inheritedStores,
835 $this->storeMode,
836 $this->name,
837 $this->contactEmail,
838 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
839 $this->customerGroupAssignments,
840 $this->addresses,
841 $this->shippingAddressIds,
842 $this->defaultShippingAddressId,
843 $this->billingAddressIds,
844 $this->defaultBillingAddressId,
845 $this->associateMode,
846 $this->associates,
847 $this->inheritedAssociates,
848 $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit,
849 $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit,
850 $this->approvalRuleMode
851 );
852 }
853
854 public static function of(): BusinessUnitBuilder
855 {
856 return new self();
857 }
858}
withInheritedAssociates(?InheritedAssociateCollection $inheritedAssociates)
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withInheritedStores(?StoreKeyReferenceCollection $inheritedStores)
withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments)
withTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit)
withTopLevelUnitBuilder(?BusinessUnitKeyReferenceBuilder $topLevelUnit)
withParentUnitBuilder(?BusinessUnitKeyReferenceBuilder $parentUnit)