commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
AddressDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
23 final class AddressDraftBuilder implements Builder
24 {
29  private $id;
30 
35  private $key;
36 
41  private $country;
42 
47  private $title;
48 
53  private $salutation;
54 
59  private $firstName;
60 
65  private $lastName;
66 
71  private $streetName;
72 
77  private $streetNumber;
78 
83  private $additionalStreetInfo;
84 
89  private $postalCode;
90 
95  private $city;
96 
101  private $region;
102 
107  private $state;
108 
113  private $company;
114 
119  private $department;
120 
125  private $building;
126 
131  private $apartment;
132 
137  private $pOBox;
138 
143  private $phone;
144 
149  private $mobile;
150 
155  private $email;
156 
161  private $fax;
162 
167  private $additionalAddressInfo;
168 
173  private $externalId;
174 
179  private $custom;
180 
189  public function getId()
190  {
191  return $this->id;
192  }
193 
200  public function getKey()
201  {
202  return $this->key;
203  }
204 
211  public function getCountry()
212  {
213  return $this->country;
214  }
215 
222  public function getTitle()
223  {
224  return $this->title;
225  }
226 
233  public function getSalutation()
234  {
235  return $this->salutation;
236  }
237 
244  public function getFirstName()
245  {
246  return $this->firstName;
247  }
248 
255  public function getLastName()
256  {
257  return $this->lastName;
258  }
259 
266  public function getStreetName()
267  {
268  return $this->streetName;
269  }
270 
277  public function getStreetNumber()
278  {
279  return $this->streetNumber;
280  }
281 
288  public function getAdditionalStreetInfo()
289  {
290  return $this->additionalStreetInfo;
291  }
292 
299  public function getPostalCode()
300  {
301  return $this->postalCode;
302  }
303 
310  public function getCity()
311  {
312  return $this->city;
313  }
314 
321  public function getRegion()
322  {
323  return $this->region;
324  }
325 
332  public function getState()
333  {
334  return $this->state;
335  }
336 
343  public function getCompany()
344  {
345  return $this->company;
346  }
347 
354  public function getDepartment()
355  {
356  return $this->department;
357  }
358 
365  public function getBuilding()
366  {
367  return $this->building;
368  }
369 
376  public function getApartment()
377  {
378  return $this->apartment;
379  }
380 
387  public function getPOBox()
388  {
389  return $this->pOBox;
390  }
391 
398  public function getPhone()
399  {
400  return $this->phone;
401  }
402 
409  public function getMobile()
410  {
411  return $this->mobile;
412  }
413 
420  public function getEmail()
421  {
422  return $this->email;
423  }
424 
431  public function getFax()
432  {
433  return $this->fax;
434  }
435 
442  public function getAdditionalAddressInfo()
443  {
444  return $this->additionalAddressInfo;
445  }
446 
453  public function getExternalId()
454  {
455  return $this->externalId;
456  }
457 
464  public function getCustom()
465  {
466  return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
467  }
468 
473  public function withId(?string $id)
474  {
475  $this->id = $id;
476 
477  return $this;
478  }
479 
484  public function withKey(?string $key)
485  {
486  $this->key = $key;
487 
488  return $this;
489  }
490 
495  public function withCountry(?string $country)
496  {
497  $this->country = $country;
498 
499  return $this;
500  }
501 
506  public function withTitle(?string $title)
507  {
508  $this->title = $title;
509 
510  return $this;
511  }
512 
517  public function withSalutation(?string $salutation)
518  {
519  $this->salutation = $salutation;
520 
521  return $this;
522  }
523 
528  public function withFirstName(?string $firstName)
529  {
530  $this->firstName = $firstName;
531 
532  return $this;
533  }
534 
539  public function withLastName(?string $lastName)
540  {
541  $this->lastName = $lastName;
542 
543  return $this;
544  }
545 
550  public function withStreetName(?string $streetName)
551  {
552  $this->streetName = $streetName;
553 
554  return $this;
555  }
556 
561  public function withStreetNumber(?string $streetNumber)
562  {
563  $this->streetNumber = $streetNumber;
564 
565  return $this;
566  }
567 
572  public function withAdditionalStreetInfo(?string $additionalStreetInfo)
573  {
574  $this->additionalStreetInfo = $additionalStreetInfo;
575 
576  return $this;
577  }
578 
583  public function withPostalCode(?string $postalCode)
584  {
585  $this->postalCode = $postalCode;
586 
587  return $this;
588  }
589 
594  public function withCity(?string $city)
595  {
596  $this->city = $city;
597 
598  return $this;
599  }
600 
605  public function withRegion(?string $region)
606  {
607  $this->region = $region;
608 
609  return $this;
610  }
611 
616  public function withState(?string $state)
617  {
618  $this->state = $state;
619 
620  return $this;
621  }
622 
627  public function withCompany(?string $company)
628  {
629  $this->company = $company;
630 
631  return $this;
632  }
633 
638  public function withDepartment(?string $department)
639  {
640  $this->department = $department;
641 
642  return $this;
643  }
644 
649  public function withBuilding(?string $building)
650  {
651  $this->building = $building;
652 
653  return $this;
654  }
655 
660  public function withApartment(?string $apartment)
661  {
662  $this->apartment = $apartment;
663 
664  return $this;
665  }
666 
671  public function withPOBox(?string $pOBox)
672  {
673  $this->pOBox = $pOBox;
674 
675  return $this;
676  }
677 
682  public function withPhone(?string $phone)
683  {
684  $this->phone = $phone;
685 
686  return $this;
687  }
688 
693  public function withMobile(?string $mobile)
694  {
695  $this->mobile = $mobile;
696 
697  return $this;
698  }
699 
704  public function withEmail(?string $email)
705  {
706  $this->email = $email;
707 
708  return $this;
709  }
710 
715  public function withFax(?string $fax)
716  {
717  $this->fax = $fax;
718 
719  return $this;
720  }
721 
726  public function withAdditionalAddressInfo(?string $additionalAddressInfo)
727  {
728  $this->additionalAddressInfo = $additionalAddressInfo;
729 
730  return $this;
731  }
732 
737  public function withExternalId(?string $externalId)
738  {
739  $this->externalId = $externalId;
740 
741  return $this;
742  }
743 
748  public function withCustom(?CustomFieldsDraft $custom)
749  {
750  $this->custom = $custom;
751 
752  return $this;
753  }
754 
759  public function withCustomBuilder(?CustomFieldsDraftBuilder $custom)
760  {
761  $this->custom = $custom;
762 
763  return $this;
764  }
765 
766  public function build(): AddressDraft
767  {
768  return new AddressDraftModel(
769  $this->id,
770  $this->key,
771  $this->country,
772  $this->title,
773  $this->salutation,
774  $this->firstName,
775  $this->lastName,
776  $this->streetName,
777  $this->streetNumber,
778  $this->additionalStreetInfo,
779  $this->postalCode,
780  $this->city,
781  $this->region,
782  $this->state,
783  $this->company,
784  $this->department,
785  $this->building,
786  $this->apartment,
787  $this->pOBox,
788  $this->phone,
789  $this->mobile,
790  $this->email,
791  $this->fax,
792  $this->additionalAddressInfo,
793  $this->externalId,
794  $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
795  );
796  }
797 
798  public static function of(): AddressDraftBuilder
799  {
800  return new self();
801  }
802 }
withCustomBuilder(?CustomFieldsDraftBuilder $custom)