commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
AssociateDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
23final class AssociateDraftBuilder implements Builder
24{
29 private $associateRoleAssignments;
30
35 private $customer;
36
44 {
45 return $this->associateRoleAssignments;
46 }
47
54 public function getCustomer()
55 {
56 return $this->customer instanceof CustomerResourceIdentifierBuilder ? $this->customer->build() : $this->customer;
57 }
58
63 public function withAssociateRoleAssignments(?AssociateRoleAssignmentDraftCollection $associateRoleAssignments)
64 {
65 $this->associateRoleAssignments = $associateRoleAssignments;
66
67 return $this;
68 }
69
74 public function withCustomer(?CustomerResourceIdentifier $customer)
75 {
76 $this->customer = $customer;
77
78 return $this;
79 }
80
86 {
87 $this->customer = $customer;
88
89 return $this;
90 }
91
92 public function build(): AssociateDraft
93 {
94 return new AssociateDraftModel(
95 $this->associateRoleAssignments,
96 $this->customer instanceof CustomerResourceIdentifierBuilder ? $this->customer->build() : $this->customer
97 );
98 }
99
100 public static function of(): AssociateDraftBuilder
101 {
102 return new self();
103 }
104}
withAssociateRoleAssignments(?AssociateRoleAssignmentDraftCollection $associateRoleAssignments)
withCustomerBuilder(?CustomerResourceIdentifierBuilder $customer)