commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
CustomerAddressBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
23 final class CustomerAddressBuilder implements Builder
24 {
29  private $key;
30 
35  private $title;
36 
41  private $salutation;
42 
47  private $firstName;
48 
53  private $lastName;
54 
59  private $streetName;
60 
65  private $streetNumber;
66 
71  private $additionalStreetInfo;
72 
77  private $postalCode;
78 
83  private $city;
84 
89  private $region;
90 
95  private $state;
96 
101  private $country;
102 
107  private $company;
108 
113  private $department;
114 
119  private $building;
120 
125  private $apartment;
126 
131  private $pOBox;
132 
137  private $phone;
138 
143  private $mobile;
144 
149  private $email;
150 
155  private $fax;
156 
161  private $additionalAddressInfo;
162 
167  private $externalId;
168 
173  private $custom;
174 
182  public function getKey()
183  {
184  return $this->key;
185  }
186 
191  public function getTitle()
192  {
193  return $this->title;
194  }
195 
200  public function getSalutation()
201  {
202  return $this->salutation;
203  }
204 
209  public function getFirstName()
210  {
211  return $this->firstName;
212  }
213 
218  public function getLastName()
219  {
220  return $this->lastName;
221  }
222 
227  public function getStreetName()
228  {
229  return $this->streetName;
230  }
231 
236  public function getStreetNumber()
237  {
238  return $this->streetNumber;
239  }
240 
245  public function getAdditionalStreetInfo()
246  {
247  return $this->additionalStreetInfo;
248  }
249 
254  public function getPostalCode()
255  {
256  return $this->postalCode;
257  }
258 
263  public function getCity()
264  {
265  return $this->city;
266  }
267 
272  public function getRegion()
273  {
274  return $this->region;
275  }
276 
281  public function getState()
282  {
283  return $this->state;
284  }
285 
292  public function getCountry()
293  {
294  return $this->country;
295  }
296 
301  public function getCompany()
302  {
303  return $this->company;
304  }
305 
310  public function getDepartment()
311  {
312  return $this->department;
313  }
314 
319  public function getBuilding()
320  {
321  return $this->building;
322  }
323 
328  public function getApartment()
329  {
330  return $this->apartment;
331  }
332 
337  public function getPOBox()
338  {
339  return $this->pOBox;
340  }
341 
346  public function getPhone()
347  {
348  return $this->phone;
349  }
350 
355  public function getMobile()
356  {
357  return $this->mobile;
358  }
359 
364  public function getEmail()
365  {
366  return $this->email;
367  }
368 
373  public function getFax()
374  {
375  return $this->fax;
376  }
377 
382  public function getAdditionalAddressInfo()
383  {
384  return $this->additionalAddressInfo;
385  }
386 
391  public function getExternalId()
392  {
393  return $this->externalId;
394  }
395 
402  public function getCustom()
403  {
404  return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom;
405  }
406 
411  public function withKey(?string $key)
412  {
413  $this->key = $key;
414 
415  return $this;
416  }
417 
422  public function withTitle(?string $title)
423  {
424  $this->title = $title;
425 
426  return $this;
427  }
428 
433  public function withSalutation(?string $salutation)
434  {
435  $this->salutation = $salutation;
436 
437  return $this;
438  }
439 
444  public function withFirstName(?string $firstName)
445  {
446  $this->firstName = $firstName;
447 
448  return $this;
449  }
450 
455  public function withLastName(?string $lastName)
456  {
457  $this->lastName = $lastName;
458 
459  return $this;
460  }
461 
466  public function withStreetName(?string $streetName)
467  {
468  $this->streetName = $streetName;
469 
470  return $this;
471  }
472 
477  public function withStreetNumber(?string $streetNumber)
478  {
479  $this->streetNumber = $streetNumber;
480 
481  return $this;
482  }
483 
488  public function withAdditionalStreetInfo(?string $additionalStreetInfo)
489  {
490  $this->additionalStreetInfo = $additionalStreetInfo;
491 
492  return $this;
493  }
494 
499  public function withPostalCode(?string $postalCode)
500  {
501  $this->postalCode = $postalCode;
502 
503  return $this;
504  }
505 
510  public function withCity(?string $city)
511  {
512  $this->city = $city;
513 
514  return $this;
515  }
516 
521  public function withRegion(?string $region)
522  {
523  $this->region = $region;
524 
525  return $this;
526  }
527 
532  public function withState(?string $state)
533  {
534  $this->state = $state;
535 
536  return $this;
537  }
538 
543  public function withCountry(?string $country)
544  {
545  $this->country = $country;
546 
547  return $this;
548  }
549 
554  public function withCompany(?string $company)
555  {
556  $this->company = $company;
557 
558  return $this;
559  }
560 
565  public function withDepartment(?string $department)
566  {
567  $this->department = $department;
568 
569  return $this;
570  }
571 
576  public function withBuilding(?string $building)
577  {
578  $this->building = $building;
579 
580  return $this;
581  }
582 
587  public function withApartment(?string $apartment)
588  {
589  $this->apartment = $apartment;
590 
591  return $this;
592  }
593 
598  public function withPOBox(?string $pOBox)
599  {
600  $this->pOBox = $pOBox;
601 
602  return $this;
603  }
604 
609  public function withPhone(?string $phone)
610  {
611  $this->phone = $phone;
612 
613  return $this;
614  }
615 
620  public function withMobile(?string $mobile)
621  {
622  $this->mobile = $mobile;
623 
624  return $this;
625  }
626 
631  public function withEmail(?string $email)
632  {
633  $this->email = $email;
634 
635  return $this;
636  }
637 
642  public function withFax(?string $fax)
643  {
644  $this->fax = $fax;
645 
646  return $this;
647  }
648 
653  public function withAdditionalAddressInfo(?string $additionalAddressInfo)
654  {
655  $this->additionalAddressInfo = $additionalAddressInfo;
656 
657  return $this;
658  }
659 
664  public function withExternalId(?string $externalId)
665  {
666  $this->externalId = $externalId;
667 
668  return $this;
669  }
670 
675  public function withCustom(?Custom $custom)
676  {
677  $this->custom = $custom;
678 
679  return $this;
680  }
681 
686  public function withCustomBuilder(?CustomBuilder $custom)
687  {
688  $this->custom = $custom;
689 
690  return $this;
691  }
692 
693  public function build(): CustomerAddress
694  {
695  return new CustomerAddressModel(
696  $this->key,
697  $this->title,
698  $this->salutation,
699  $this->firstName,
700  $this->lastName,
701  $this->streetName,
702  $this->streetNumber,
703  $this->additionalStreetInfo,
704  $this->postalCode,
705  $this->city,
706  $this->region,
707  $this->state,
708  $this->country,
709  $this->company,
710  $this->department,
711  $this->building,
712  $this->apartment,
713  $this->pOBox,
714  $this->phone,
715  $this->mobile,
716  $this->email,
717  $this->fax,
718  $this->additionalAddressInfo,
719  $this->externalId,
720  $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom
721  );
722  }
723 
724  public static function of(): CustomerAddressBuilder
725  {
726  return new self();
727  }
728 }