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 $storeMode;
91
96 private $name;
97
102 private $contactEmail;
103
108 private $custom;
109
114 private $addresses;
115
120 private $shippingAddressIds;
121
126 private $defaultShippingAddressId;
127
132 private $billingAddressIds;
133
138 private $defaultBillingAddressId;
139
144 private $associateMode;
145
150 private $associates;
151
156 private $inheritedAssociates;
157
162 private $parentUnit;
163
168 private $topLevelUnit;
169
174 private $approvalRuleMode;
175
182 public function getId()
183 {
184 return $this->id;
185 }
186
193 public function getVersion()
194 {
195 return $this->version;
196 }
197
204 public function getCreatedAt()
205 {
206 return $this->createdAt;
207 }
208
215 public function getLastModifiedAt()
216 {
217 return $this->lastModifiedAt;
218 }
219
226 public function getLastModifiedBy()
227 {
228 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
229 }
230
237 public function getCreatedBy()
238 {
239 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
240 }
241
248 public function getKey()
249 {
250 return $this->key;
251 }
252
259 public function getStatus()
260 {
261 return $this->status;
262 }
263
272 public function getStores()
273 {
274 return $this->stores;
275 }
276
283 public function getStoreMode()
284 {
285 return $this->storeMode;
286 }
287
294 public function getName()
295 {
296 return $this->name;
297 }
298
305 public function getContactEmail()
306 {
307 return $this->contactEmail;
308 }
309
316 public function getCustom()
317 {
318 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
319 }
320
327 public function getAddresses()
328 {
329 return $this->addresses;
330 }
331
338 public function getShippingAddressIds()
339 {
340 return $this->shippingAddressIds;
341 }
342
350 {
351 return $this->defaultShippingAddressId;
352 }
353
360 public function getBillingAddressIds()
361 {
362 return $this->billingAddressIds;
363 }
364
372 {
373 return $this->defaultBillingAddressId;
374 }
375
382 public function getAssociateMode()
383 {
384 return $this->associateMode;
385 }
386
393 public function getAssociates()
394 {
395 return $this->associates;
396 }
397
404 public function getInheritedAssociates()
405 {
406 return $this->inheritedAssociates;
407 }
408
415 public function getParentUnit()
416 {
417 return $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit;
418 }
419
426 public function getTopLevelUnit()
427 {
428 return $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit;
429 }
430
437 public function getApprovalRuleMode()
438 {
439 return $this->approvalRuleMode;
440 }
441
446 public function withId(?string $id)
447 {
448 $this->id = $id;
449
450 return $this;
451 }
452
457 public function withVersion(?int $version)
458 {
459 $this->version = $version;
460
461 return $this;
462 }
463
468 public function withCreatedAt(?DateTimeImmutable $createdAt)
469 {
470 $this->createdAt = $createdAt;
471
472 return $this;
473 }
474
479 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
480 {
481 $this->lastModifiedAt = $lastModifiedAt;
482
483 return $this;
484 }
485
490 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
491 {
492 $this->lastModifiedBy = $lastModifiedBy;
493
494 return $this;
495 }
496
501 public function withCreatedBy(?CreatedBy $createdBy)
502 {
503 $this->createdBy = $createdBy;
504
505 return $this;
506 }
507
512 public function withKey(?string $key)
513 {
514 $this->key = $key;
515
516 return $this;
517 }
518
523 public function withStatus(?string $status)
524 {
525 $this->status = $status;
526
527 return $this;
528 }
529
534 public function withStores(?StoreKeyReferenceCollection $stores)
535 {
536 $this->stores = $stores;
537
538 return $this;
539 }
540
545 public function withStoreMode(?string $storeMode)
546 {
547 $this->storeMode = $storeMode;
548
549 return $this;
550 }
551
556 public function withName(?string $name)
557 {
558 $this->name = $name;
559
560 return $this;
561 }
562
567 public function withContactEmail(?string $contactEmail)
568 {
569 $this->contactEmail = $contactEmail;
570
571 return $this;
572 }
573
578 public function withCustom(?CustomFields $custom)
579 {
580 $this->custom = $custom;
581
582 return $this;
583 }
584
589 public function withAddresses(?AddressCollection $addresses)
590 {
591 $this->addresses = $addresses;
592
593 return $this;
594 }
595
600 public function withShippingAddressIds(?array $shippingAddressIds)
601 {
602 $this->shippingAddressIds = $shippingAddressIds;
603
604 return $this;
605 }
606
611 public function withDefaultShippingAddressId(?string $defaultShippingAddressId)
612 {
613 $this->defaultShippingAddressId = $defaultShippingAddressId;
614
615 return $this;
616 }
617
622 public function withBillingAddressIds(?array $billingAddressIds)
623 {
624 $this->billingAddressIds = $billingAddressIds;
625
626 return $this;
627 }
628
633 public function withDefaultBillingAddressId(?string $defaultBillingAddressId)
634 {
635 $this->defaultBillingAddressId = $defaultBillingAddressId;
636
637 return $this;
638 }
639
644 public function withAssociateMode(?string $associateMode)
645 {
646 $this->associateMode = $associateMode;
647
648 return $this;
649 }
650
655 public function withAssociates(?AssociateCollection $associates)
656 {
657 $this->associates = $associates;
658
659 return $this;
660 }
661
666 public function withInheritedAssociates(?InheritedAssociateCollection $inheritedAssociates)
667 {
668 $this->inheritedAssociates = $inheritedAssociates;
669
670 return $this;
671 }
672
677 public function withParentUnit(?BusinessUnitKeyReference $parentUnit)
678 {
679 $this->parentUnit = $parentUnit;
680
681 return $this;
682 }
683
688 public function withTopLevelUnit(?BusinessUnitKeyReference $topLevelUnit)
689 {
690 $this->topLevelUnit = $topLevelUnit;
691
692 return $this;
693 }
694
699 public function withApprovalRuleMode(?string $approvalRuleMode)
700 {
701 $this->approvalRuleMode = $approvalRuleMode;
702
703 return $this;
704 }
705
710 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
711 {
712 $this->lastModifiedBy = $lastModifiedBy;
713
714 return $this;
715 }
716
721 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
722 {
723 $this->createdBy = $createdBy;
724
725 return $this;
726 }
727
732 public function withCustomBuilder(?CustomFieldsBuilder $custom)
733 {
734 $this->custom = $custom;
735
736 return $this;
737 }
738
744 {
745 $this->parentUnit = $parentUnit;
746
747 return $this;
748 }
749
755 {
756 $this->topLevelUnit = $topLevelUnit;
757
758 return $this;
759 }
760
761 public function build(): Company
762 {
763 return new CompanyModel(
764 $this->id,
765 $this->version,
766 $this->createdAt,
767 $this->lastModifiedAt,
768 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
769 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
770 $this->key,
771 $this->status,
772 $this->stores,
773 $this->storeMode,
774 $this->name,
775 $this->contactEmail,
776 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
777 $this->addresses,
778 $this->shippingAddressIds,
779 $this->defaultShippingAddressId,
780 $this->billingAddressIds,
781 $this->defaultBillingAddressId,
782 $this->associateMode,
783 $this->associates,
784 $this->inheritedAssociates,
785 $this->parentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->parentUnit->build() : $this->parentUnit,
786 $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit,
787 $this->approvalRuleMode
788 );
789 }
790
791 public static function of(): CompanyBuilder
792 {
793 return new self();
794 }
795}
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)
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)