commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
MyCustomerDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
20use DateTimeImmutable;
21use stdClass;
22
26final class MyCustomerDraftBuilder implements Builder
27{
32 private $email;
33
38 private $password;
39
44 private $firstName;
45
50 private $lastName;
51
56 private $middleName;
57
62 private $title;
63
68 private $salutation;
69
74 private $dateOfBirth;
75
80 private $companyName;
81
86 private $vatId;
87
92 private $addresses;
93
98 private $defaultShippingAddress;
99
104 private $defaultBillingAddress;
105
110 private $custom;
111
116 private $locale;
117
122 private $stores;
123
131 public function getEmail()
132 {
133 return $this->email;
134 }
135
142 public function getPassword()
143 {
144 return $this->password;
145 }
146
153 public function getFirstName()
154 {
155 return $this->firstName;
156 }
157
164 public function getLastName()
165 {
166 return $this->lastName;
167 }
168
175 public function getMiddleName()
176 {
177 return $this->middleName;
178 }
179
186 public function getTitle()
187 {
188 return $this->title;
189 }
190
197 public function getSalutation()
198 {
199 return $this->salutation;
200 }
201
208 public function getDateOfBirth()
209 {
210 return $this->dateOfBirth;
211 }
212
219 public function getCompanyName()
220 {
221 return $this->companyName;
222 }
223
230 public function getVatId()
231 {
232 return $this->vatId;
233 }
234
241 public function getAddresses()
242 {
243 return $this->addresses;
244 }
245
254 {
255 return $this->defaultShippingAddress;
256 }
257
265 public function getDefaultBillingAddress()
266 {
267 return $this->defaultBillingAddress;
268 }
269
276 public function getCustom()
277 {
278 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
279 }
280
287 public function getLocale()
288 {
289 return $this->locale;
290 }
291
298 public function getStores()
299 {
300 return $this->stores;
301 }
302
307 public function withEmail(?string $email)
308 {
309 $this->email = $email;
310
311 return $this;
312 }
313
318 public function withPassword(?string $password)
319 {
320 $this->password = $password;
321
322 return $this;
323 }
324
329 public function withFirstName(?string $firstName)
330 {
331 $this->firstName = $firstName;
332
333 return $this;
334 }
335
340 public function withLastName(?string $lastName)
341 {
342 $this->lastName = $lastName;
343
344 return $this;
345 }
346
351 public function withMiddleName(?string $middleName)
352 {
353 $this->middleName = $middleName;
354
355 return $this;
356 }
357
362 public function withTitle(?string $title)
363 {
364 $this->title = $title;
365
366 return $this;
367 }
368
373 public function withSalutation(?string $salutation)
374 {
375 $this->salutation = $salutation;
376
377 return $this;
378 }
379
384 public function withDateOfBirth(?DateTimeImmutable $dateOfBirth)
385 {
386 $this->dateOfBirth = $dateOfBirth;
387
388 return $this;
389 }
390
395 public function withCompanyName(?string $companyName)
396 {
397 $this->companyName = $companyName;
398
399 return $this;
400 }
401
406 public function withVatId(?string $vatId)
407 {
408 $this->vatId = $vatId;
409
410 return $this;
411 }
412
417 public function withAddresses(?BaseAddressCollection $addresses)
418 {
419 $this->addresses = $addresses;
420
421 return $this;
422 }
423
428 public function withDefaultShippingAddress(?int $defaultShippingAddress)
429 {
430 $this->defaultShippingAddress = $defaultShippingAddress;
431
432 return $this;
433 }
434
439 public function withDefaultBillingAddress(?int $defaultBillingAddress)
440 {
441 $this->defaultBillingAddress = $defaultBillingAddress;
442
443 return $this;
444 }
445
450 public function withCustom(?CustomFieldsDraft $custom)
451 {
452 $this->custom = $custom;
453
454 return $this;
455 }
456
461 public function withLocale(?string $locale)
462 {
463 $this->locale = $locale;
464
465 return $this;
466 }
467
473 {
474 $this->stores = $stores;
475
476 return $this;
477 }
478
484 {
485 $this->custom = $custom;
486
487 return $this;
488 }
489
490 public function build(): MyCustomerDraft
491 {
492 return new MyCustomerDraftModel(
493 $this->email,
494 $this->password,
495 $this->firstName,
496 $this->lastName,
497 $this->middleName,
498 $this->title,
499 $this->salutation,
500 $this->dateOfBirth,
501 $this->companyName,
502 $this->vatId,
503 $this->addresses,
504 $this->defaultShippingAddress,
505 $this->defaultBillingAddress,
506 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom,
507 $this->locale,
508 $this->stores
509 );
510 }
511
512 public static function of(): MyCustomerDraftBuilder
513 {
514 return new self();
515 }
516}
withStores(?StoreResourceIdentifierCollection $stores)