commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CustomerSigninBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
23final class CustomerSigninBuilder implements Builder
24{
29 private $email;
30
35 private $password;
36
41 private $anonymousCartId;
42
47 private $anonymousCart;
48
53 private $anonymousCartSignInMode;
54
59 private $anonymousId;
60
65 private $updateProductData;
66
73 public function getEmail()
74 {
75 return $this->email;
76 }
77
84 public function getPassword()
85 {
86 return $this->password;
87 }
88
95 public function getAnonymousCartId()
96 {
97 return $this->anonymousCartId;
98 }
99
106 public function getAnonymousCart()
107 {
108 return $this->anonymousCart instanceof CartResourceIdentifierBuilder ? $this->anonymousCart->build() : $this->anonymousCart;
109 }
110
121 {
122 return $this->anonymousCartSignInMode;
123 }
124
133 public function getAnonymousId()
134 {
135 return $this->anonymousId;
136 }
137
147 public function getUpdateProductData()
148 {
149 return $this->updateProductData;
150 }
151
156 public function withEmail(?string $email)
157 {
158 $this->email = $email;
159
160 return $this;
161 }
162
167 public function withPassword(?string $password)
168 {
169 $this->password = $password;
170
171 return $this;
172 }
173
178 public function withAnonymousCartId(?string $anonymousCartId)
179 {
180 $this->anonymousCartId = $anonymousCartId;
181
182 return $this;
183 }
184
189 public function withAnonymousCart(?CartResourceIdentifier $anonymousCart)
190 {
191 $this->anonymousCart = $anonymousCart;
192
193 return $this;
194 }
195
200 public function withAnonymousCartSignInMode(?string $anonymousCartSignInMode)
201 {
202 $this->anonymousCartSignInMode = $anonymousCartSignInMode;
203
204 return $this;
205 }
206
211 public function withAnonymousId(?string $anonymousId)
212 {
213 $this->anonymousId = $anonymousId;
214
215 return $this;
216 }
217
222 public function withUpdateProductData(?bool $updateProductData)
223 {
224 $this->updateProductData = $updateProductData;
225
226 return $this;
227 }
228
234 {
235 $this->anonymousCart = $anonymousCart;
236
237 return $this;
238 }
239
240 public function build(): CustomerSignin
241 {
242 return new CustomerSigninModel(
243 $this->email,
244 $this->password,
245 $this->anonymousCartId,
246 $this->anonymousCart instanceof CartResourceIdentifierBuilder ? $this->anonymousCart->build() : $this->anonymousCart,
247 $this->anonymousCartSignInMode,
248 $this->anonymousId,
249 $this->updateProductData
250 );
251 }
252
253 public static function of(): CustomerSigninBuilder
254 {
255 return new self();
256 }
257}
withAnonymousCart(?CartResourceIdentifier $anonymousCart)
withAnonymousCartBuilder(?CartResourceIdentifierBuilder $anonymousCart)