commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CompanyBuilder.php
1<?php
2
3declare(strict_types=1);
10
25use DateTimeImmutable;
26use stdClass;
27
31final class CompanyBuilder implements Builder
32{
37 private $id;
38
43 private $version;
44
49 private $createdAt;
50
55 private $lastModifiedAt;
56
61 private $lastModifiedBy;
62
67 private $createdBy;
68
73 private $key;
74
79 private $status;
80
85 private $stores;
86
91 private $inheritedStores;
92
97 private $storeMode;
98
103 private $name;
104
109 private $contactEmail;
110
115 private $custom;
116
121 private $customerGroupAssignments;
122
127 private $addresses;
128
133 private $shippingAddressIds;
134
139 private $defaultShippingAddressId;
140
145 private $billingAddressIds;
146
151 private $defaultBillingAddressId;
152
157 private $associateMode;
158
163 private $associates;
164
169 private $inheritedAssociates;
170
175 private $parentUnit;
176
181 private $topLevelUnit;
182
187 private $approvalRuleMode;
188
195 public function getId()
196 {
197 return $this->id;
198 }
199
206 public function getVersion()
207 {
208 return $this->version;
209 }
210
217 public function getCreatedAt()
218 {
219 return $this->createdAt;
220 }
221
228 public function getLastModifiedAt()
229 {
230 return $this->lastModifiedAt;
231 }
232
239 public function getLastModifiedBy()
240 {
241 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
242 }
243
250 public function getCreatedBy()
251 {
252 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
253 }
254
261 public function getKey()
262 {
263 return $this->key;
264 }
265
272 public function getStatus()
273 {
274 return $this->status;
275 }
276
285 public function getStores()
286 {
287 return $this->stores;
288 }
289
296 public function getInheritedStores()
297 {
298 return $this->inheritedStores;
299 }
300
307 public function getStoreMode()
308 {
309 return $this->storeMode;
310 }
311
318 public function getName()
319 {
320 return $this->name;
321 }
322
329 public function getContactEmail()
330 {
331 return $this->contactEmail;
332 }
333
340 public function getCustom()
341 {
342 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
343 }
344
353 {
354 return $this->customerGroupAssignments;
355 }
356
363 public function getAddresses()
364 {
365 return $this->addresses;
366 }
367
374 public function getShippingAddressIds()
375 {
376 return $this->shippingAddressIds;
377 }
378
386 {
387 return $this->defaultShippingAddressId;
388 }
389
396 public function getBillingAddressIds()
397 {
398 return $this->billingAddressIds;
399 }
400
408 {
409 return $this->defaultBillingAddressId;
410 }
411
418 public function getAssociateMode()
419 {
420 return $this->associateMode;
421 }
422
429 public function getAssociates()
430 {
431 return $this->associates;
432 }
433
440 public function getInheritedAssociates()
441 {
442 return $this->inheritedAssociates;
443 }
444
451 public function getParentUnit()
452 {
453 return $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit;
454 }
455
462 public function getTopLevelUnit()
463 {
464 return $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit;
465 }
466
473 public function getApprovalRuleMode()
474 {
475 return $this->approvalRuleMode;
476 }
477
482 public function withId(?string $id)
483 {
484 $this->id = $id;
485
486 return $this;
487 }
488
493 public function withVersion(?int $version)
494 {
495 $this->version = $version;
496
497 return $this;
498 }
499
504 public function withCreatedAt(?DateTimeImmutable $createdAt)
505 {
506 $this->createdAt = $createdAt;
507
508 return $this;
509 }
510
515 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
516 {
517 $this->lastModifiedAt = $lastModifiedAt;
518
519 return $this;
520 }
521
526 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
527 {
528 $this->lastModifiedBy = $lastModifiedBy;
529
530 return $this;
531 }
532
537 public function withCreatedBy(?CreatedBy $createdBy)
538 {
539 $this->createdBy = $createdBy;
540
541 return $this;
542 }
543
548 public function withKey(?string $key)
549 {
550 $this->key = $key;
551
552 return $this;
553 }
554
559 public function withStatus(?string $status)
560 {
561 $this->status = $status;
562
563 return $this;
564 }
565
570 public function withStores(?StoreKeyReferenceCollection $stores)
571 {
572 $this->stores = $stores;
573
574 return $this;
575 }
576
581 public function withInheritedStores(?StoreKeyReferenceCollection $inheritedStores)
582 {
583 $this->inheritedStores = $inheritedStores;
584
585 return $this;
586 }
587
592 public function withStoreMode(?string $storeMode)
593 {
594 $this->storeMode = $storeMode;
595
596 return $this;
597 }
598
603 public function withName(?string $name)
604 {
605 $this->name = $name;
606
607 return $this;
608 }
609
614 public function withContactEmail(?string $contactEmail)
615 {
616 $this->contactEmail = $contactEmail;
617
618 return $this;
619 }
620
625 public function withCustom(?CustomFields $custom)
626 {
627 $this->custom = $custom;
628
629 return $this;
630 }
631
636 public function withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments)
637 {
638 $this->customerGroupAssignments = $customerGroupAssignments;
639
640 return $this;
641 }
642
647 public function withAddresses(?AddressCollection $addresses)
648 {
649 $this->addresses = $addresses;
650
651 return $this;
652 }
653
658 public function withShippingAddressIds(?array $shippingAddressIds)
659 {
660 $this->shippingAddressIds = $shippingAddressIds;
661
662 return $this;
663 }
664
669 public function withDefaultShippingAddressId(?string $defaultShippingAddressId)
670 {
671 $this->defaultShippingAddressId = $defaultShippingAddressId;
672
673 return $this;
674 }
675
680 public function withBillingAddressIds(?array $billingAddressIds)
681 {
682 $this->billingAddressIds = $billingAddressIds;
683
684 return $this;
685 }
686
691 public function withDefaultBillingAddressId(?string $defaultBillingAddressId)
692 {
693 $this->defaultBillingAddressId = $defaultBillingAddressId;
694
695 return $this;
696 }
697
702 public function withAssociateMode(?string $associateMode)
703 {
704 $this->associateMode = $associateMode;
705
706 return $this;
707 }
708
713 public function withAssociates(?AssociateCollection $associates)
714 {
715 $this->associates = $associates;
716
717 return $this;
718 }
719
724 public function withInheritedAssociates(?InheritedAssociateCollection $inheritedAssociates)
725 {
726 $this->inheritedAssociates = $inheritedAssociates;
727
728 return $this;
729 }
730
735 public function withParentUnit(?BusinessUnitKeyReference $parentUnit)
736 {
737 $this->parentUnit = $parentUnit;
738
739 return $this;
740 }
741
746 public function withTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit)
747 {
748 $this->topLevelUnit = $topLevelUnit;
749
750 return $this;
751 }
752
757 public function withApprovalRuleMode(?string $approvalRuleMode)
758 {
759 $this->approvalRuleMode = $approvalRuleMode;
760
761 return $this;
762 }
763
768 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
769 {
770 $this->lastModifiedBy = $lastModifiedBy;
771
772 return $this;
773 }
774
779 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
780 {
781 $this->createdBy = $createdBy;
782
783 return $this;
784 }
785
790 public function withCustomBuilder(?CustomFieldsBuilder $custom)
791 {
792 $this->custom = $custom;
793
794 return $this;
795 }
796
802 {
803 $this->parentUnit = $parentUnit;
804
805 return $this;
806 }
807
813 {
814 $this->topLevelUnit = $topLevelUnit;
815
816 return $this;
817 }
818
819 public function build(): Company
820 {
821 return new CompanyModel(
822 $this->id,
823 $this->version,
824 $this->createdAt,
825 $this->lastModifiedAt,
826 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
827 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
828 $this->key,
829 $this->status,
830 $this->stores,
831 $this->inheritedStores,
832 $this->storeMode,
833 $this->name,
834 $this->contactEmail,
835 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
836 $this->customerGroupAssignments,
837 $this->addresses,
838 $this->shippingAddressIds,
839 $this->defaultShippingAddressId,
840 $this->billingAddressIds,
841 $this->defaultBillingAddressId,
842 $this->associateMode,
843 $this->associates,
844 $this->inheritedAssociates,
845 $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit,
846 $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit,
847 $this->approvalRuleMode
848 );
849 }
850
851 public static function of(): CompanyBuilder
852 {
853 return new self();
854 }
855}
withDefaultShippingAddressId(?string $defaultShippingAddressId)
withDefaultBillingAddressId(?string $defaultBillingAddressId)
withStores(?StoreKeyReferenceCollection $stores)
withParentUnitBuilder(?BusinessUnitKeyReferenceBuilder $parentUnit)
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
withParentUnit(?BusinessUnitKeyReference $parentUnit)
withTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit)
withInheritedAssociates(?InheritedAssociateCollection $inheritedAssociates)
withTopLevelUnitBuilder(?BusinessUnitKeyReferenceBuilder $topLevelUnit)
withCustomerGroupAssignments(?CustomerGroupAssignmentCollection $customerGroupAssignments)
withInheritedStores(?StoreKeyReferenceCollection $inheritedStores)
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)