commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
AddressBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
23 final class AddressBuilder implements Builder
24 {
29  private $id;
30 
35  private $key;
36 
41  private $title;
42 
47  private $salutation;
48 
53  private $firstName;
54 
59  private $lastName;
60 
65  private $streetName;
66 
71  private $streetNumber;
72 
77  private $additionalStreetInfo;
78 
83  private $postalCode;
84 
89  private $city;
90 
95  private $region;
96 
101  private $state;
102 
107  private $country;
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 
185  public function getId()
186  {
187  return $this->id;
188  }
189 
194  public function getKey()
195  {
196  return $this->key;
197  }
198 
203  public function getTitle()
204  {
205  return $this->title;
206  }
207 
212  public function getSalutation()
213  {
214  return $this->salutation;
215  }
216 
221  public function getFirstName()
222  {
223  return $this->firstName;
224  }
225 
230  public function getLastName()
231  {
232  return $this->lastName;
233  }
234 
239  public function getStreetName()
240  {
241  return $this->streetName;
242  }
243 
248  public function getStreetNumber()
249  {
250  return $this->streetNumber;
251  }
252 
257  public function getAdditionalStreetInfo()
258  {
259  return $this->additionalStreetInfo;
260  }
261 
266  public function getPostalCode()
267  {
268  return $this->postalCode;
269  }
270 
275  public function getCity()
276  {
277  return $this->city;
278  }
279 
284  public function getRegion()
285  {
286  return $this->region;
287  }
288 
293  public function getState()
294  {
295  return $this->state;
296  }
297 
304  public function getCountry()
305  {
306  return $this->country;
307  }
308 
313  public function getCompany()
314  {
315  return $this->company;
316  }
317 
322  public function getDepartment()
323  {
324  return $this->department;
325  }
326 
331  public function getBuilding()
332  {
333  return $this->building;
334  }
335 
340  public function getApartment()
341  {
342  return $this->apartment;
343  }
344 
349  public function getPOBox()
350  {
351  return $this->pOBox;
352  }
353 
358  public function getPhone()
359  {
360  return $this->phone;
361  }
362 
367  public function getMobile()
368  {
369  return $this->mobile;
370  }
371 
376  public function getEmail()
377  {
378  return $this->email;
379  }
380 
385  public function getFax()
386  {
387  return $this->fax;
388  }
389 
394  public function getAdditionalAddressInfo()
395  {
396  return $this->additionalAddressInfo;
397  }
398 
403  public function getExternalId()
404  {
405  return $this->externalId;
406  }
407 
414  public function getCustom()
415  {
416  return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom;
417  }
418 
423  public function withId(?string $id)
424  {
425  $this->id = $id;
426 
427  return $this;
428  }
429 
434  public function withKey(?string $key)
435  {
436  $this->key = $key;
437 
438  return $this;
439  }
440 
445  public function withTitle(?string $title)
446  {
447  $this->title = $title;
448 
449  return $this;
450  }
451 
456  public function withSalutation(?string $salutation)
457  {
458  $this->salutation = $salutation;
459 
460  return $this;
461  }
462 
467  public function withFirstName(?string $firstName)
468  {
469  $this->firstName = $firstName;
470 
471  return $this;
472  }
473 
478  public function withLastName(?string $lastName)
479  {
480  $this->lastName = $lastName;
481 
482  return $this;
483  }
484 
489  public function withStreetName(?string $streetName)
490  {
491  $this->streetName = $streetName;
492 
493  return $this;
494  }
495 
500  public function withStreetNumber(?string $streetNumber)
501  {
502  $this->streetNumber = $streetNumber;
503 
504  return $this;
505  }
506 
511  public function withAdditionalStreetInfo(?string $additionalStreetInfo)
512  {
513  $this->additionalStreetInfo = $additionalStreetInfo;
514 
515  return $this;
516  }
517 
522  public function withPostalCode(?string $postalCode)
523  {
524  $this->postalCode = $postalCode;
525 
526  return $this;
527  }
528 
533  public function withCity(?string $city)
534  {
535  $this->city = $city;
536 
537  return $this;
538  }
539 
544  public function withRegion(?string $region)
545  {
546  $this->region = $region;
547 
548  return $this;
549  }
550 
555  public function withState(?string $state)
556  {
557  $this->state = $state;
558 
559  return $this;
560  }
561 
566  public function withCountry(?string $country)
567  {
568  $this->country = $country;
569 
570  return $this;
571  }
572 
577  public function withCompany(?string $company)
578  {
579  $this->company = $company;
580 
581  return $this;
582  }
583 
588  public function withDepartment(?string $department)
589  {
590  $this->department = $department;
591 
592  return $this;
593  }
594 
599  public function withBuilding(?string $building)
600  {
601  $this->building = $building;
602 
603  return $this;
604  }
605 
610  public function withApartment(?string $apartment)
611  {
612  $this->apartment = $apartment;
613 
614  return $this;
615  }
616 
621  public function withPOBox(?string $pOBox)
622  {
623  $this->pOBox = $pOBox;
624 
625  return $this;
626  }
627 
632  public function withPhone(?string $phone)
633  {
634  $this->phone = $phone;
635 
636  return $this;
637  }
638 
643  public function withMobile(?string $mobile)
644  {
645  $this->mobile = $mobile;
646 
647  return $this;
648  }
649 
654  public function withEmail(?string $email)
655  {
656  $this->email = $email;
657 
658  return $this;
659  }
660 
665  public function withFax(?string $fax)
666  {
667  $this->fax = $fax;
668 
669  return $this;
670  }
671 
676  public function withAdditionalAddressInfo(?string $additionalAddressInfo)
677  {
678  $this->additionalAddressInfo = $additionalAddressInfo;
679 
680  return $this;
681  }
682 
687  public function withExternalId(?string $externalId)
688  {
689  $this->externalId = $externalId;
690 
691  return $this;
692  }
693 
698  public function withCustom(?Custom $custom)
699  {
700  $this->custom = $custom;
701 
702  return $this;
703  }
704 
709  public function withCustomBuilder(?CustomBuilder $custom)
710  {
711  $this->custom = $custom;
712 
713  return $this;
714  }
715 
716  public function build(): Address
717  {
718  return new AddressModel(
719  $this->id,
720  $this->key,
721  $this->title,
722  $this->salutation,
723  $this->firstName,
724  $this->lastName,
725  $this->streetName,
726  $this->streetNumber,
727  $this->additionalStreetInfo,
728  $this->postalCode,
729  $this->city,
730  $this->region,
731  $this->state,
732  $this->country,
733  $this->company,
734  $this->department,
735  $this->building,
736  $this->apartment,
737  $this->pOBox,
738  $this->phone,
739  $this->mobile,
740  $this->email,
741  $this->fax,
742  $this->additionalAddressInfo,
743  $this->externalId,
744  $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom
745  );
746  }
747 
748  public static function of(): AddressBuilder
749  {
750  return new self();
751  }
752 }
withAdditionalAddressInfo(?string $additionalAddressInfo)
withAdditionalStreetInfo(?string $additionalStreetInfo)