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
24use DateTimeImmutable;
25use stdClass;
26
30final class CompanyBuilder implements Builder
31{
36 private $id;
37
42 private $version;
43
48 private $createdAt;
49
54 private $lastModifiedAt;
55
60 private $lastModifiedBy;
61
66 private $createdBy;
67
72 private $key;
73
78 private $status;
79
84 private $stores;
85
90 private $inheritedStores;
91
96 private $storeMode;
97
102 private $name;
103
108 private $contactEmail;
109
114 private $custom;
115
120 private $addresses;
121
126 private $shippingAddressIds;
127
132 private $defaultShippingAddressId;
133
138 private $billingAddressIds;
139
144 private $defaultBillingAddressId;
145
150 private $associateMode;
151
156 private $associates;
157
162 private $inheritedAssociates;
163
168 private $parentUnit;
169
174 private $topLevelUnit;
175
180 private $approvalRuleMode;
181
188 public function getId()
189 {
190 return $this->id;
191 }
192
199 public function getVersion()
200 {
201 return $this->version;
202 }
203
210 public function getCreatedAt()
211 {
212 return $this->createdAt;
213 }
214
221 public function getLastModifiedAt()
222 {
223 return $this->lastModifiedAt;
224 }
225
232 public function getLastModifiedBy()
233 {
234 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
235 }
236
243 public function getCreatedBy()
244 {
245 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
246 }
247
254 public function getKey()
255 {
256 return $this->key;
257 }
258
265 public function getStatus()
266 {
267 return $this->status;
268 }
269
278 public function getStores()
279 {
280 return $this->stores;
281 }
282
289 public function getInheritedStores()
290 {
291 return $this->inheritedStores;
292 }
293
300 public function getStoreMode()
301 {
302 return $this->storeMode;
303 }
304
311 public function getName()
312 {
313 return $this->name;
314 }
315
322 public function getContactEmail()
323 {
324 return $this->contactEmail;
325 }
326
333 public function getCustom()
334 {
335 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
336 }
337
344 public function getAddresses()
345 {
346 return $this->addresses;
347 }
348
355 public function getShippingAddressIds()
356 {
357 return $this->shippingAddressIds;
358 }
359
367 {
368 return $this->defaultShippingAddressId;
369 }
370
377 public function getBillingAddressIds()
378 {
379 return $this->billingAddressIds;
380 }
381
389 {
390 return $this->defaultBillingAddressId;
391 }
392
399 public function getAssociateMode()
400 {
401 return $this->associateMode;
402 }
403
410 public function getAssociates()
411 {
412 return $this->associates;
413 }
414
421 public function getInheritedAssociates()
422 {
423 return $this->inheritedAssociates;
424 }
425
432 public function getParentUnit()
433 {
434 return $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit;
435 }
436
443 public function getTopLevelUnit()
444 {
445 return $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit;
446 }
447
454 public function getApprovalRuleMode()
455 {
456 return $this->approvalRuleMode;
457 }
458
463 public function withId(?string $id)
464 {
465 $this->id = $id;
466
467 return $this;
468 }
469
474 public function withVersion(?int $version)
475 {
476 $this->version = $version;
477
478 return $this;
479 }
480
485 public function withCreatedAt(?DateTimeImmutable $createdAt)
486 {
487 $this->createdAt = $createdAt;
488
489 return $this;
490 }
491
496 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
497 {
498 $this->lastModifiedAt = $lastModifiedAt;
499
500 return $this;
501 }
502
507 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
508 {
509 $this->lastModifiedBy = $lastModifiedBy;
510
511 return $this;
512 }
513
518 public function withCreatedBy(?CreatedBy $createdBy)
519 {
520 $this->createdBy = $createdBy;
521
522 return $this;
523 }
524
529 public function withKey(?string $key)
530 {
531 $this->key = $key;
532
533 return $this;
534 }
535
540 public function withStatus(?string $status)
541 {
542 $this->status = $status;
543
544 return $this;
545 }
546
551 public function withStores(?StoreKeyReferenceCollection $stores)
552 {
553 $this->stores = $stores;
554
555 return $this;
556 }
557
562 public function withInheritedStores(?StoreKeyReferenceCollection $inheritedStores)
563 {
564 $this->inheritedStores = $inheritedStores;
565
566 return $this;
567 }
568
573 public function withStoreMode(?string $storeMode)
574 {
575 $this->storeMode = $storeMode;
576
577 return $this;
578 }
579
584 public function withName(?string $name)
585 {
586 $this->name = $name;
587
588 return $this;
589 }
590
595 public function withContactEmail(?string $contactEmail)
596 {
597 $this->contactEmail = $contactEmail;
598
599 return $this;
600 }
601
606 public function withCustom(?CustomFields $custom)
607 {
608 $this->custom = $custom;
609
610 return $this;
611 }
612
617 public function withAddresses(?AddressCollection $addresses)
618 {
619 $this->addresses = $addresses;
620
621 return $this;
622 }
623
628 public function withShippingAddressIds(?array $shippingAddressIds)
629 {
630 $this->shippingAddressIds = $shippingAddressIds;
631
632 return $this;
633 }
634
639 public function withDefaultShippingAddressId(?string $defaultShippingAddressId)
640 {
641 $this->defaultShippingAddressId = $defaultShippingAddressId;
642
643 return $this;
644 }
645
650 public function withBillingAddressIds(?array $billingAddressIds)
651 {
652 $this->billingAddressIds = $billingAddressIds;
653
654 return $this;
655 }
656
661 public function withDefaultBillingAddressId(?string $defaultBillingAddressId)
662 {
663 $this->defaultBillingAddressId = $defaultBillingAddressId;
664
665 return $this;
666 }
667
672 public function withAssociateMode(?string $associateMode)
673 {
674 $this->associateMode = $associateMode;
675
676 return $this;
677 }
678
683 public function withAssociates(?AssociateCollection $associates)
684 {
685 $this->associates = $associates;
686
687 return $this;
688 }
689
694 public function withInheritedAssociates(?InheritedAssociateCollection $inheritedAssociates)
695 {
696 $this->inheritedAssociates = $inheritedAssociates;
697
698 return $this;
699 }
700
705 public function withParentUnit(?BusinessUnitKeyReference $parentUnit)
706 {
707 $this->parentUnit = $parentUnit;
708
709 return $this;
710 }
711
716 public function withTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit)
717 {
718 $this->topLevelUnit = $topLevelUnit;
719
720 return $this;
721 }
722
727 public function withApprovalRuleMode(?string $approvalRuleMode)
728 {
729 $this->approvalRuleMode = $approvalRuleMode;
730
731 return $this;
732 }
733
738 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
739 {
740 $this->lastModifiedBy = $lastModifiedBy;
741
742 return $this;
743 }
744
749 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
750 {
751 $this->createdBy = $createdBy;
752
753 return $this;
754 }
755
760 public function withCustomBuilder(?CustomFieldsBuilder $custom)
761 {
762 $this->custom = $custom;
763
764 return $this;
765 }
766
772 {
773 $this->parentUnit = $parentUnit;
774
775 return $this;
776 }
777
783 {
784 $this->topLevelUnit = $topLevelUnit;
785
786 return $this;
787 }
788
789 public function build(): Company
790 {
791 return new CompanyModel(
792 $this->id,
793 $this->version,
794 $this->createdAt,
795 $this->lastModifiedAt,
796 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
797 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
798 $this->key,
799 $this->status,
800 $this->stores,
801 $this->inheritedStores,
802 $this->storeMode,
803 $this->name,
804 $this->contactEmail,
805 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
806 $this->addresses,
807 $this->shippingAddressIds,
808 $this->defaultShippingAddressId,
809 $this->billingAddressIds,
810 $this->defaultBillingAddressId,
811 $this->associateMode,
812 $this->associates,
813 $this->inheritedAssociates,
814 $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit,
815 $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit,
816 $this->approvalRuleMode
817 );
818 }
819
820 public static function of(): CompanyBuilder
821 {
822 return new self();
823 }
824}
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)
withInheritedStores(?StoreKeyReferenceCollection $inheritedStores)
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)