commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
CustomerSigninModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
22 final class CustomerSigninModel extends JsonObjectModel implements CustomerSignin
23 {
28  protected $email;
29 
34  protected $password;
35 
40  protected $anonymousCartId;
41 
46  protected $anonymousCart;
47 
53 
58  protected $anonymousId;
59 
64  protected $updateProductData;
65 
66 
70  public function __construct(
71  ?string $email = null,
72  ?string $password = null,
73  ?string $anonymousCartId = null,
75  ?string $anonymousCartSignInMode = null,
76  ?string $anonymousId = null,
77  ?bool $updateProductData = null
78  ) {
79  $this->email = $email;
80  $this->password = $password;
81  $this->anonymousCartId = $anonymousCartId;
82  $this->anonymousCart = $anonymousCart;
83  $this->anonymousCartSignInMode = $anonymousCartSignInMode;
84  $this->anonymousId = $anonymousId;
85  $this->updateProductData = $updateProductData;
86  }
87 
94  public function getEmail()
95  {
96  if (is_null($this->email)) {
98  $data = $this->raw(self::FIELD_EMAIL);
99  if (is_null($data)) {
100  return null;
101  }
102  $this->email = (string) $data;
103  }
104 
105  return $this->email;
106  }
107 
114  public function getPassword()
115  {
116  if (is_null($this->password)) {
118  $data = $this->raw(self::FIELD_PASSWORD);
119  if (is_null($data)) {
120  return null;
121  }
122  $this->password = (string) $data;
123  }
124 
125  return $this->password;
126  }
127 
134  public function getAnonymousCartId()
135  {
136  if (is_null($this->anonymousCartId)) {
138  $data = $this->raw(self::FIELD_ANONYMOUS_CART_ID);
139  if (is_null($data)) {
140  return null;
141  }
142  $this->anonymousCartId = (string) $data;
143  }
144 
145  return $this->anonymousCartId;
146  }
147 
154  public function getAnonymousCart()
155  {
156  if (is_null($this->anonymousCart)) {
158  $data = $this->raw(self::FIELD_ANONYMOUS_CART);
159  if (is_null($data)) {
160  return null;
161  }
162 
163  $this->anonymousCart = CartResourceIdentifierModel::of($data);
164  }
165 
166  return $this->anonymousCart;
167  }
168 
178  public function getAnonymousCartSignInMode()
179  {
180  if (is_null($this->anonymousCartSignInMode)) {
182  $data = $this->raw(self::FIELD_ANONYMOUS_CART_SIGN_IN_MODE);
183  if (is_null($data)) {
184  return null;
185  }
186  $this->anonymousCartSignInMode = (string) $data;
187  }
188 
190  }
191 
200  public function getAnonymousId()
201  {
202  if (is_null($this->anonymousId)) {
204  $data = $this->raw(self::FIELD_ANONYMOUS_ID);
205  if (is_null($data)) {
206  return null;
207  }
208  $this->anonymousId = (string) $data;
209  }
210 
211  return $this->anonymousId;
212  }
213 
223  public function getUpdateProductData()
224  {
225  if (is_null($this->updateProductData)) {
227  $data = $this->raw(self::FIELD_UPDATE_PRODUCT_DATA);
228  if (is_null($data)) {
229  return null;
230  }
231  $this->updateProductData = (bool) $data;
232  }
233 
235  }
236 
237 
241  public function setEmail(?string $email): void
242  {
243  $this->email = $email;
244  }
245 
249  public function setPassword(?string $password): void
250  {
251  $this->password = $password;
252  }
253 
257  public function setAnonymousCartId(?string $anonymousCartId): void
258  {
259  $this->anonymousCartId = $anonymousCartId;
260  }
261 
266  {
267  $this->anonymousCart = $anonymousCart;
268  }
269 
274  {
275  $this->anonymousCartSignInMode = $anonymousCartSignInMode;
276  }
277 
281  public function setAnonymousId(?string $anonymousId): void
282  {
283  $this->anonymousId = $anonymousId;
284  }
285 
289  public function setUpdateProductData(?bool $updateProductData): void
290  {
291  $this->updateProductData = $updateProductData;
292  }
293 }
setAnonymousCart(?CartResourceIdentifier $anonymousCart)
setAnonymousCartSignInMode(?string $anonymousCartSignInMode)
__construct(?string $email=null, ?string $password=null, ?string $anonymousCartId=null, ?CartResourceIdentifier $anonymousCart=null, ?string $anonymousCartSignInMode=null, ?string $anonymousId=null, ?bool $updateProductData=null)