commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
All Classes Namespaces Functions Variables Pages
ClientLoggingBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
23final class ClientLoggingBuilder implements Builder
24{
29 private $clientId;
30
35 private $externalUserId;
36
41 private $customer;
42
47 private $anonymousId;
48
53 private $associate;
54
61 public function getClientId()
62 {
63 return $this->clientId;
64 }
65
72 public function getExternalUserId()
73 {
74 return $this->externalUserId;
75 }
76
83 public function getCustomer()
84 {
85 return $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer;
86 }
87
94 public function getAnonymousId()
95 {
96 return $this->anonymousId;
97 }
98
105 public function getAssociate()
106 {
107 return $this->associate instanceof CustomerReferenceBuilder ? $this->associate->build() : $this->associate;
108 }
109
114 public function withClientId(?string $clientId)
115 {
116 $this->clientId = $clientId;
117
118 return $this;
119 }
120
125 public function withExternalUserId(?string $externalUserId)
126 {
127 $this->externalUserId = $externalUserId;
128
129 return $this;
130 }
131
136 public function withCustomer(?CustomerReference $customer)
137 {
138 $this->customer = $customer;
139
140 return $this;
141 }
142
147 public function withAnonymousId(?string $anonymousId)
148 {
149 $this->anonymousId = $anonymousId;
150
151 return $this;
152 }
153
158 public function withAssociate(?CustomerReference $associate)
159 {
160 $this->associate = $associate;
161
162 return $this;
163 }
164
170 {
171 $this->customer = $customer;
172
173 return $this;
174 }
175
181 {
182 $this->associate = $associate;
183
184 return $this;
185 }
186
187 public function build(): ClientLogging
188 {
189 return new ClientLoggingModel(
190 $this->clientId,
191 $this->externalUserId,
192 $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer,
193 $this->anonymousId,
194 $this->associate instanceof CustomerReferenceBuilder ? $this->associate->build() : $this->associate
195 );
196 }
197
198 public static function of(): ClientLoggingBuilder
199 {
200 return new self();
201 }
202}
withAssociateBuilder(?CustomerReferenceBuilder $associate)
withCustomerBuilder(?CustomerReferenceBuilder $customer)