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
146 public function getUpdateProductData()
147 {
148 return $this->updateProductData;
149 }
150
155 public function withEmail(?string $email)
156 {
157 $this->email = $email;
158
159 return $this;
160 }
161
166 public function withPassword(?string $password)
167 {
168 $this->password = $password;
169
170 return $this;
171 }
172
177 public function withAnonymousCartId(?string $anonymousCartId)
178 {
179 $this->anonymousCartId = $anonymousCartId;
180
181 return $this;
182 }
183
188 public function withAnonymousCart(?CartResourceIdentifier $anonymousCart)
189 {
190 $this->anonymousCart = $anonymousCart;
191
192 return $this;
193 }
194
199 public function withAnonymousCartSignInMode(?string $anonymousCartSignInMode)
200 {
201 $this->anonymousCartSignInMode = $anonymousCartSignInMode;
202
203 return $this;
204 }
205
210 public function withAnonymousId(?string $anonymousId)
211 {
212 $this->anonymousId = $anonymousId;
213
214 return $this;
215 }
216
221 public function withUpdateProductData(?bool $updateProductData)
222 {
223 $this->updateProductData = $updateProductData;
224
225 return $this;
226 }
227
233 {
234 $this->anonymousCart = $anonymousCart;
235
236 return $this;
237 }
238
239 public function build(): CustomerSignin
240 {
241 return new CustomerSigninModel(
242 $this->email,
243 $this->password,
244 $this->anonymousCartId,
245 $this->anonymousCart instanceof CartResourceIdentifierBuilder ? $this->anonymousCart->build() : $this->anonymousCart,
246 $this->anonymousCartSignInMode,
247 $this->anonymousId,
248 $this->updateProductData
249 );
250 }
251
252 public static function of(): CustomerSigninBuilder
253 {
254 return new self();
255 }
256}
withAnonymousCart(?CartResourceIdentifier $anonymousCart)
withAnonymousCartBuilder(?CartResourceIdentifierBuilder $anonymousCart)