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
26use DateTimeImmutable;
27use stdClass;
28
32final class BusinessUnitBuilder implements Builder
33{
38 private $id;
39
44 private $version;
45
50 private $createdAt;
51
56 private $lastModifiedAt;
57
62 private $lastModifiedBy;
63
68 private $createdBy;
69
74 private $key;
75
80 private $status;
81
86 private $stores;
87
92 private $inheritedStores;
93
98 private $storeMode;
99
104 private $name;
105
110 private $contactEmail;
111
116 private $custom;
117
122 private $addresses;
123
128 private $shippingAddressIds;
129
134 private $defaultShippingAddressId;
135
140 private $billingAddressIds;
141
146 private $defaultBillingAddressId;
147
152 private $associateMode;
153
158 private $associates;
159
164 private $inheritedAssociates;
165
170 private $parentUnit;
171
176 private $topLevelUnit;
177
182 private $approvalRuleMode;
183
190 public function getId()
191 {
192 return $this->id;
193 }
194
201 public function getVersion()
202 {
203 return $this->version;
204 }
205
212 public function getCreatedAt()
213 {
214 return $this->createdAt;
215 }
216
223 public function getLastModifiedAt()
224 {
225 return $this->lastModifiedAt;
226 }
227
234 public function getLastModifiedBy()
235 {
236 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
237 }
238
245 public function getCreatedBy()
246 {
247 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
248 }
249
256 public function getKey()
257 {
258 return $this->key;
259 }
260
267 public function getStatus()
268 {
269 return $this->status;
270 }
271
280 public function getStores()
281 {
282 return $this->stores;
283 }
284
291 public function getInheritedStores()
292 {
293 return $this->inheritedStores;
294 }
295
302 public function getStoreMode()
303 {
304 return $this->storeMode;
305 }
306
313 public function getName()
314 {
315 return $this->name;
316 }
317
324 public function getContactEmail()
325 {
326 return $this->contactEmail;
327 }
328
335 public function getCustom()
336 {
337 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
338 }
339
346 public function getAddresses()
347 {
348 return $this->addresses;
349 }
350
357 public function getShippingAddressIds()
358 {
359 return $this->shippingAddressIds;
360 }
361
369 {
370 return $this->defaultShippingAddressId;
371 }
372
379 public function getBillingAddressIds()
380 {
381 return $this->billingAddressIds;
382 }
383
391 {
392 return $this->defaultBillingAddressId;
393 }
394
401 public function getAssociateMode()
402 {
403 return $this->associateMode;
404 }
405
412 public function getAssociates()
413 {
414 return $this->associates;
415 }
416
423 public function getInheritedAssociates()
424 {
425 return $this->inheritedAssociates;
426 }
427
434 public function getParentUnit()
435 {
436 return $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit;
437 }
438
445 public function getTopLevelUnit()
446 {
447 return $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit;
448 }
449
457 public function getApprovalRuleMode()
458 {
459 return $this->approvalRuleMode;
460 }
461
466 public function withId(?string $id)
467 {
468 $this->id = $id;
469
470 return $this;
471 }
472
477 public function withVersion(?int $version)
478 {
479 $this->version = $version;
480
481 return $this;
482 }
483
488 public function withCreatedAt(?DateTimeImmutable $createdAt)
489 {
490 $this->createdAt = $createdAt;
491
492 return $this;
493 }
494
499 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
500 {
501 $this->lastModifiedAt = $lastModifiedAt;
502
503 return $this;
504 }
505
510 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
511 {
512 $this->lastModifiedBy = $lastModifiedBy;
513
514 return $this;
515 }
516
521 public function withCreatedBy(?CreatedBy $createdBy)
522 {
523 $this->createdBy = $createdBy;
524
525 return $this;
526 }
527
532 public function withKey(?string $key)
533 {
534 $this->key = $key;
535
536 return $this;
537 }
538
543 public function withStatus(?string $status)
544 {
545 $this->status = $status;
546
547 return $this;
548 }
549
554 public function withStores(?StoreKeyReferenceCollection $stores)
555 {
556 $this->stores = $stores;
557
558 return $this;
559 }
560
565 public function withInheritedStores(?StoreKeyReferenceCollection $inheritedStores)
566 {
567 $this->inheritedStores = $inheritedStores;
568
569 return $this;
570 }
571
576 public function withStoreMode(?string $storeMode)
577 {
578 $this->storeMode = $storeMode;
579
580 return $this;
581 }
582
587 public function withName(?string $name)
588 {
589 $this->name = $name;
590
591 return $this;
592 }
593
598 public function withContactEmail(?string $contactEmail)
599 {
600 $this->contactEmail = $contactEmail;
601
602 return $this;
603 }
604
609 public function withCustom(?CustomFields $custom)
610 {
611 $this->custom = $custom;
612
613 return $this;
614 }
615
620 public function withAddresses(?AddressCollection $addresses)
621 {
622 $this->addresses = $addresses;
623
624 return $this;
625 }
626
631 public function withShippingAddressIds(?array $shippingAddressIds)
632 {
633 $this->shippingAddressIds = $shippingAddressIds;
634
635 return $this;
636 }
637
642 public function withDefaultShippingAddressId(?string $defaultShippingAddressId)
643 {
644 $this->defaultShippingAddressId = $defaultShippingAddressId;
645
646 return $this;
647 }
648
653 public function withBillingAddressIds(?array $billingAddressIds)
654 {
655 $this->billingAddressIds = $billingAddressIds;
656
657 return $this;
658 }
659
664 public function withDefaultBillingAddressId(?string $defaultBillingAddressId)
665 {
666 $this->defaultBillingAddressId = $defaultBillingAddressId;
667
668 return $this;
669 }
670
675 public function withAssociateMode(?string $associateMode)
676 {
677 $this->associateMode = $associateMode;
678
679 return $this;
680 }
681
686 public function withAssociates(?AssociateCollection $associates)
687 {
688 $this->associates = $associates;
689
690 return $this;
691 }
692
697 public function withInheritedAssociates(?InheritedAssociateCollection $inheritedAssociates)
698 {
699 $this->inheritedAssociates = $inheritedAssociates;
700
701 return $this;
702 }
703
708 public function withParentUnit(?BusinessUnitKeyReference $parentUnit)
709 {
710 $this->parentUnit = $parentUnit;
711
712 return $this;
713 }
714
719 public function withTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit)
720 {
721 $this->topLevelUnit = $topLevelUnit;
722
723 return $this;
724 }
725
730 public function withApprovalRuleMode(?string $approvalRuleMode)
731 {
732 $this->approvalRuleMode = $approvalRuleMode;
733
734 return $this;
735 }
736
741 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
742 {
743 $this->lastModifiedBy = $lastModifiedBy;
744
745 return $this;
746 }
747
752 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
753 {
754 $this->createdBy = $createdBy;
755
756 return $this;
757 }
758
763 public function withCustomBuilder(?CustomFieldsBuilder $custom)
764 {
765 $this->custom = $custom;
766
767 return $this;
768 }
769
775 {
776 $this->parentUnit = $parentUnit;
777
778 return $this;
779 }
780
786 {
787 $this->topLevelUnit = $topLevelUnit;
788
789 return $this;
790 }
791
792 public function build(): BusinessUnit
793 {
794 return new BusinessUnitModel(
795 $this->id,
796 $this->version,
797 $this->createdAt,
798 $this->lastModifiedAt,
799 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
800 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
801 $this->key,
802 $this->status,
803 $this->stores,
804 $this->inheritedStores,
805 $this->storeMode,
806 $this->name,
807 $this->contactEmail,
808 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
809 $this->addresses,
810 $this->shippingAddressIds,
811 $this->defaultShippingAddressId,
812 $this->billingAddressIds,
813 $this->defaultBillingAddressId,
814 $this->associateMode,
815 $this->associates,
816 $this->inheritedAssociates,
817 $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit,
818 $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit,
819 $this->approvalRuleMode
820 );
821 }
822
823 public static function of(): BusinessUnitBuilder
824 {
825 return new self();
826 }
827}
withInheritedAssociates(?InheritedAssociateCollection $inheritedAssociates)
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withInheritedStores(?StoreKeyReferenceCollection $inheritedStores)
withTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit)
withTopLevelUnitBuilder(?BusinessUnitKeyReferenceBuilder $topLevelUnit)
withParentUnitBuilder(?BusinessUnitKeyReferenceBuilder $parentUnit)