commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
AddressModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
22 final class AddressModel extends JsonObjectModel implements Address
23 {
28  protected $id;
29 
34  protected $key;
35 
40  protected $title;
41 
46  protected $salutation;
47 
52  protected $firstName;
53 
58  protected $lastName;
59 
64  protected $streetName;
65 
70  protected $streetNumber;
71 
77 
82  protected $postalCode;
83 
88  protected $city;
89 
94  protected $region;
95 
100  protected $state;
101 
106  protected $country;
107 
112  protected $company;
113 
118  protected $department;
119 
124  protected $building;
125 
130  protected $apartment;
131 
136  protected $pOBox;
137 
142  protected $phone;
143 
148  protected $mobile;
149 
154  protected $email;
155 
160  protected $fax;
161 
167 
172  protected $externalId;
173 
178  protected $custom;
179 
180 
184  public function __construct(
185  ?string $id = null,
186  ?string $key = null,
187  ?string $title = null,
188  ?string $salutation = null,
189  ?string $firstName = null,
190  ?string $lastName = null,
191  ?string $streetName = null,
192  ?string $streetNumber = null,
193  ?string $additionalStreetInfo = null,
194  ?string $postalCode = null,
195  ?string $city = null,
196  ?string $region = null,
197  ?string $state = null,
198  ?string $country = null,
199  ?string $company = null,
200  ?string $department = null,
201  ?string $building = null,
202  ?string $apartment = null,
203  ?string $pOBox = null,
204  ?string $phone = null,
205  ?string $mobile = null,
206  ?string $email = null,
207  ?string $fax = null,
208  ?string $additionalAddressInfo = null,
209  ?string $externalId = null,
210  ?Custom $custom = null
211  ) {
212  $this->id = $id;
213  $this->key = $key;
214  $this->title = $title;
215  $this->salutation = $salutation;
216  $this->firstName = $firstName;
217  $this->lastName = $lastName;
218  $this->streetName = $streetName;
219  $this->streetNumber = $streetNumber;
220  $this->additionalStreetInfo = $additionalStreetInfo;
221  $this->postalCode = $postalCode;
222  $this->city = $city;
223  $this->region = $region;
224  $this->state = $state;
225  $this->country = $country;
226  $this->company = $company;
227  $this->department = $department;
228  $this->building = $building;
229  $this->apartment = $apartment;
230  $this->pOBox = $pOBox;
231  $this->phone = $phone;
232  $this->mobile = $mobile;
233  $this->email = $email;
234  $this->fax = $fax;
235  $this->additionalAddressInfo = $additionalAddressInfo;
236  $this->externalId = $externalId;
237  $this->custom = $custom;
238  }
239 
244  public function getId()
245  {
246  if (is_null($this->id)) {
248  $data = $this->raw(self::FIELD_ID);
249  if (is_null($data)) {
250  return null;
251  }
252  $this->id = (string) $data;
253  }
254 
255  return $this->id;
256  }
257 
262  public function getKey()
263  {
264  if (is_null($this->key)) {
266  $data = $this->raw(self::FIELD_KEY);
267  if (is_null($data)) {
268  return null;
269  }
270  $this->key = (string) $data;
271  }
272 
273  return $this->key;
274  }
275 
280  public function getTitle()
281  {
282  if (is_null($this->title)) {
284  $data = $this->raw(self::FIELD_TITLE);
285  if (is_null($data)) {
286  return null;
287  }
288  $this->title = (string) $data;
289  }
290 
291  return $this->title;
292  }
293 
298  public function getSalutation()
299  {
300  if (is_null($this->salutation)) {
302  $data = $this->raw(self::FIELD_SALUTATION);
303  if (is_null($data)) {
304  return null;
305  }
306  $this->salutation = (string) $data;
307  }
308 
309  return $this->salutation;
310  }
311 
316  public function getFirstName()
317  {
318  if (is_null($this->firstName)) {
320  $data = $this->raw(self::FIELD_FIRST_NAME);
321  if (is_null($data)) {
322  return null;
323  }
324  $this->firstName = (string) $data;
325  }
326 
327  return $this->firstName;
328  }
329 
334  public function getLastName()
335  {
336  if (is_null($this->lastName)) {
338  $data = $this->raw(self::FIELD_LAST_NAME);
339  if (is_null($data)) {
340  return null;
341  }
342  $this->lastName = (string) $data;
343  }
344 
345  return $this->lastName;
346  }
347 
352  public function getStreetName()
353  {
354  if (is_null($this->streetName)) {
356  $data = $this->raw(self::FIELD_STREET_NAME);
357  if (is_null($data)) {
358  return null;
359  }
360  $this->streetName = (string) $data;
361  }
362 
363  return $this->streetName;
364  }
365 
370  public function getStreetNumber()
371  {
372  if (is_null($this->streetNumber)) {
374  $data = $this->raw(self::FIELD_STREET_NUMBER);
375  if (is_null($data)) {
376  return null;
377  }
378  $this->streetNumber = (string) $data;
379  }
380 
381  return $this->streetNumber;
382  }
383 
388  public function getAdditionalStreetInfo()
389  {
390  if (is_null($this->additionalStreetInfo)) {
392  $data = $this->raw(self::FIELD_ADDITIONAL_STREET_INFO);
393  if (is_null($data)) {
394  return null;
395  }
396  $this->additionalStreetInfo = (string) $data;
397  }
398 
400  }
401 
406  public function getPostalCode()
407  {
408  if (is_null($this->postalCode)) {
410  $data = $this->raw(self::FIELD_POSTAL_CODE);
411  if (is_null($data)) {
412  return null;
413  }
414  $this->postalCode = (string) $data;
415  }
416 
417  return $this->postalCode;
418  }
419 
424  public function getCity()
425  {
426  if (is_null($this->city)) {
428  $data = $this->raw(self::FIELD_CITY);
429  if (is_null($data)) {
430  return null;
431  }
432  $this->city = (string) $data;
433  }
434 
435  return $this->city;
436  }
437 
442  public function getRegion()
443  {
444  if (is_null($this->region)) {
446  $data = $this->raw(self::FIELD_REGION);
447  if (is_null($data)) {
448  return null;
449  }
450  $this->region = (string) $data;
451  }
452 
453  return $this->region;
454  }
455 
460  public function getState()
461  {
462  if (is_null($this->state)) {
464  $data = $this->raw(self::FIELD_STATE);
465  if (is_null($data)) {
466  return null;
467  }
468  $this->state = (string) $data;
469  }
470 
471  return $this->state;
472  }
473 
480  public function getCountry()
481  {
482  if (is_null($this->country)) {
484  $data = $this->raw(self::FIELD_COUNTRY);
485  if (is_null($data)) {
486  return null;
487  }
488  $this->country = (string) $data;
489  }
490 
491  return $this->country;
492  }
493 
498  public function getCompany()
499  {
500  if (is_null($this->company)) {
502  $data = $this->raw(self::FIELD_COMPANY);
503  if (is_null($data)) {
504  return null;
505  }
506  $this->company = (string) $data;
507  }
508 
509  return $this->company;
510  }
511 
516  public function getDepartment()
517  {
518  if (is_null($this->department)) {
520  $data = $this->raw(self::FIELD_DEPARTMENT);
521  if (is_null($data)) {
522  return null;
523  }
524  $this->department = (string) $data;
525  }
526 
527  return $this->department;
528  }
529 
534  public function getBuilding()
535  {
536  if (is_null($this->building)) {
538  $data = $this->raw(self::FIELD_BUILDING);
539  if (is_null($data)) {
540  return null;
541  }
542  $this->building = (string) $data;
543  }
544 
545  return $this->building;
546  }
547 
552  public function getApartment()
553  {
554  if (is_null($this->apartment)) {
556  $data = $this->raw(self::FIELD_APARTMENT);
557  if (is_null($data)) {
558  return null;
559  }
560  $this->apartment = (string) $data;
561  }
562 
563  return $this->apartment;
564  }
565 
570  public function getPOBox()
571  {
572  if (is_null($this->pOBox)) {
574  $data = $this->raw(self::FIELD_P_O_BOX);
575  if (is_null($data)) {
576  return null;
577  }
578  $this->pOBox = (string) $data;
579  }
580 
581  return $this->pOBox;
582  }
583 
588  public function getPhone()
589  {
590  if (is_null($this->phone)) {
592  $data = $this->raw(self::FIELD_PHONE);
593  if (is_null($data)) {
594  return null;
595  }
596  $this->phone = (string) $data;
597  }
598 
599  return $this->phone;
600  }
601 
606  public function getMobile()
607  {
608  if (is_null($this->mobile)) {
610  $data = $this->raw(self::FIELD_MOBILE);
611  if (is_null($data)) {
612  return null;
613  }
614  $this->mobile = (string) $data;
615  }
616 
617  return $this->mobile;
618  }
619 
624  public function getEmail()
625  {
626  if (is_null($this->email)) {
628  $data = $this->raw(self::FIELD_EMAIL);
629  if (is_null($data)) {
630  return null;
631  }
632  $this->email = (string) $data;
633  }
634 
635  return $this->email;
636  }
637 
642  public function getFax()
643  {
644  if (is_null($this->fax)) {
646  $data = $this->raw(self::FIELD_FAX);
647  if (is_null($data)) {
648  return null;
649  }
650  $this->fax = (string) $data;
651  }
652 
653  return $this->fax;
654  }
655 
660  public function getAdditionalAddressInfo()
661  {
662  if (is_null($this->additionalAddressInfo)) {
664  $data = $this->raw(self::FIELD_ADDITIONAL_ADDRESS_INFO);
665  if (is_null($data)) {
666  return null;
667  }
668  $this->additionalAddressInfo = (string) $data;
669  }
670 
672  }
673 
678  public function getExternalId()
679  {
680  if (is_null($this->externalId)) {
682  $data = $this->raw(self::FIELD_EXTERNAL_ID);
683  if (is_null($data)) {
684  return null;
685  }
686  $this->externalId = (string) $data;
687  }
688 
689  return $this->externalId;
690  }
691 
698  public function getCustom()
699  {
700  if (is_null($this->custom)) {
702  $data = $this->raw(self::FIELD_CUSTOM);
703  if (is_null($data)) {
704  return null;
705  }
706 
707  $this->custom = CustomModel::of($data);
708  }
709 
710  return $this->custom;
711  }
712 
713 
717  public function setId(?string $id): void
718  {
719  $this->id = $id;
720  }
721 
725  public function setKey(?string $key): void
726  {
727  $this->key = $key;
728  }
729 
733  public function setTitle(?string $title): void
734  {
735  $this->title = $title;
736  }
737 
741  public function setSalutation(?string $salutation): void
742  {
743  $this->salutation = $salutation;
744  }
745 
749  public function setFirstName(?string $firstName): void
750  {
751  $this->firstName = $firstName;
752  }
753 
757  public function setLastName(?string $lastName): void
758  {
759  $this->lastName = $lastName;
760  }
761 
765  public function setStreetName(?string $streetName): void
766  {
767  $this->streetName = $streetName;
768  }
769 
773  public function setStreetNumber(?string $streetNumber): void
774  {
775  $this->streetNumber = $streetNumber;
776  }
777 
781  public function setAdditionalStreetInfo(?string $additionalStreetInfo): void
782  {
783  $this->additionalStreetInfo = $additionalStreetInfo;
784  }
785 
789  public function setPostalCode(?string $postalCode): void
790  {
791  $this->postalCode = $postalCode;
792  }
793 
797  public function setCity(?string $city): void
798  {
799  $this->city = $city;
800  }
801 
805  public function setRegion(?string $region): void
806  {
807  $this->region = $region;
808  }
809 
813  public function setState(?string $state): void
814  {
815  $this->state = $state;
816  }
817 
821  public function setCountry(?string $country): void
822  {
823  $this->country = $country;
824  }
825 
829  public function setCompany(?string $company): void
830  {
831  $this->company = $company;
832  }
833 
837  public function setDepartment(?string $department): void
838  {
839  $this->department = $department;
840  }
841 
845  public function setBuilding(?string $building): void
846  {
847  $this->building = $building;
848  }
849 
853  public function setApartment(?string $apartment): void
854  {
855  $this->apartment = $apartment;
856  }
857 
861  public function setPOBox(?string $pOBox): void
862  {
863  $this->pOBox = $pOBox;
864  }
865 
869  public function setPhone(?string $phone): void
870  {
871  $this->phone = $phone;
872  }
873 
877  public function setMobile(?string $mobile): void
878  {
879  $this->mobile = $mobile;
880  }
881 
885  public function setEmail(?string $email): void
886  {
887  $this->email = $email;
888  }
889 
893  public function setFax(?string $fax): void
894  {
895  $this->fax = $fax;
896  }
897 
901  public function setAdditionalAddressInfo(?string $additionalAddressInfo): void
902  {
903  $this->additionalAddressInfo = $additionalAddressInfo;
904  }
905 
909  public function setExternalId(?string $externalId): void
910  {
911  $this->externalId = $externalId;
912  }
913 
917  public function setCustom(?Custom $custom): void
918  {
919  $this->custom = $custom;
920  }
921 }
setAdditionalStreetInfo(?string $additionalStreetInfo)
setAdditionalAddressInfo(?string $additionalAddressInfo)
__construct(?string $id=null, ?string $key=null, ?string $title=null, ?string $salutation=null, ?string $firstName=null, ?string $lastName=null, ?string $streetName=null, ?string $streetNumber=null, ?string $additionalStreetInfo=null, ?string $postalCode=null, ?string $city=null, ?string $region=null, ?string $state=null, ?string $country=null, ?string $company=null, ?string $department=null, ?string $building=null, ?string $apartment=null, ?string $pOBox=null, ?string $phone=null, ?string $mobile=null, ?string $email=null, ?string $fax=null, ?string $additionalAddressInfo=null, ?string $externalId=null, ?Custom $custom=null)