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
132 public function getAnonymousId()
133 {
134 return $this->anonymousId;
135 }
136
143 public function getUpdateProductData()
144 {
145 return $this->updateProductData;
146 }
147
152 public function withEmail(?string $email)
153 {
154 $this->email = $email;
155
156 return $this;
157 }
158
163 public function withPassword(?string $password)
164 {
165 $this->password = $password;
166
167 return $this;
168 }
169
174 public function withAnonymousCartId(?string $anonymousCartId)
175 {
176 $this->anonymousCartId = $anonymousCartId;
177
178 return $this;
179 }
180
185 public function withAnonymousCart(?CartResourceIdentifier $anonymousCart)
186 {
187 $this->anonymousCart = $anonymousCart;
188
189 return $this;
190 }
191
196 public function withAnonymousCartSignInMode(?string $anonymousCartSignInMode)
197 {
198 $this->anonymousCartSignInMode = $anonymousCartSignInMode;
199
200 return $this;
201 }
202
207 public function withAnonymousId(?string $anonymousId)
208 {
209 $this->anonymousId = $anonymousId;
210
211 return $this;
212 }
213
218 public function withUpdateProductData(?bool $updateProductData)
219 {
220 $this->updateProductData = $updateProductData;
221
222 return $this;
223 }
224
230 {
231 $this->anonymousCart = $anonymousCart;
232
233 return $this;
234 }
235
236 public function build(): CustomerSignin
237 {
238 return new CustomerSigninModel(
239 $this->email,
240 $this->password,
241 $this->anonymousCartId,
242 $this->anonymousCart instanceof CartResourceIdentifierBuilder ? $this->anonymousCart->build() : $this->anonymousCart,
243 $this->anonymousCartSignInMode,
244 $this->anonymousId,
245 $this->updateProductData
246 );
247 }
248
249 public static function of(): CustomerSigninBuilder
250 {
251 return new self();
252 }
253}
withAnonymousCart(?CartResourceIdentifier $anonymousCart)
withAnonymousCartBuilder(?CartResourceIdentifierBuilder $anonymousCart)