commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
BaseAddressModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class BaseAddressModel extends JsonObjectModel implements BaseAddress
21 {
26  protected $id;
27 
32  protected $key;
33 
38  protected $country;
39 
44  protected $title;
45 
50  protected $salutation;
51 
56  protected $firstName;
57 
62  protected $lastName;
63 
68  protected $streetName;
69 
74  protected $streetNumber;
75 
81 
86  protected $postalCode;
87 
92  protected $city;
93 
98  protected $region;
99 
104  protected $state;
105 
110  protected $company;
111 
116  protected $department;
117 
122  protected $building;
123 
128  protected $apartment;
129 
134  protected $pOBox;
135 
140  protected $phone;
141 
146  protected $mobile;
147 
152  protected $email;
153 
158  protected $fax;
159 
165 
170  protected $externalId;
171 
172 
176  public function __construct(
177  ?string $id = null,
178  ?string $key = null,
179  ?string $country = null,
180  ?string $title = null,
181  ?string $salutation = null,
182  ?string $firstName = null,
183  ?string $lastName = null,
184  ?string $streetName = null,
185  ?string $streetNumber = null,
186  ?string $additionalStreetInfo = null,
187  ?string $postalCode = null,
188  ?string $city = null,
189  ?string $region = null,
190  ?string $state = null,
191  ?string $company = null,
192  ?string $department = null,
193  ?string $building = null,
194  ?string $apartment = null,
195  ?string $pOBox = null,
196  ?string $phone = null,
197  ?string $mobile = null,
198  ?string $email = null,
199  ?string $fax = null,
200  ?string $additionalAddressInfo = null,
201  ?string $externalId = null
202  ) {
203  $this->id = $id;
204  $this->key = $key;
205  $this->country = $country;
206  $this->title = $title;
207  $this->salutation = $salutation;
208  $this->firstName = $firstName;
209  $this->lastName = $lastName;
210  $this->streetName = $streetName;
211  $this->streetNumber = $streetNumber;
212  $this->additionalStreetInfo = $additionalStreetInfo;
213  $this->postalCode = $postalCode;
214  $this->city = $city;
215  $this->region = $region;
216  $this->state = $state;
217  $this->company = $company;
218  $this->department = $department;
219  $this->building = $building;
220  $this->apartment = $apartment;
221  $this->pOBox = $pOBox;
222  $this->phone = $phone;
223  $this->mobile = $mobile;
224  $this->email = $email;
225  $this->fax = $fax;
226  $this->additionalAddressInfo = $additionalAddressInfo;
227  $this->externalId = $externalId;
228  }
229 
238  public function getId()
239  {
240  if (is_null($this->id)) {
242  $data = $this->raw(self::FIELD_ID);
243  if (is_null($data)) {
244  return null;
245  }
246  $this->id = (string) $data;
247  }
248 
249  return $this->id;
250  }
251 
258  public function getKey()
259  {
260  if (is_null($this->key)) {
262  $data = $this->raw(self::FIELD_KEY);
263  if (is_null($data)) {
264  return null;
265  }
266  $this->key = (string) $data;
267  }
268 
269  return $this->key;
270  }
271 
278  public function getCountry()
279  {
280  if (is_null($this->country)) {
282  $data = $this->raw(self::FIELD_COUNTRY);
283  if (is_null($data)) {
284  return null;
285  }
286  $this->country = (string) $data;
287  }
288 
289  return $this->country;
290  }
291 
298  public function getTitle()
299  {
300  if (is_null($this->title)) {
302  $data = $this->raw(self::FIELD_TITLE);
303  if (is_null($data)) {
304  return null;
305  }
306  $this->title = (string) $data;
307  }
308 
309  return $this->title;
310  }
311 
318  public function getSalutation()
319  {
320  if (is_null($this->salutation)) {
322  $data = $this->raw(self::FIELD_SALUTATION);
323  if (is_null($data)) {
324  return null;
325  }
326  $this->salutation = (string) $data;
327  }
328 
329  return $this->salutation;
330  }
331 
338  public function getFirstName()
339  {
340  if (is_null($this->firstName)) {
342  $data = $this->raw(self::FIELD_FIRST_NAME);
343  if (is_null($data)) {
344  return null;
345  }
346  $this->firstName = (string) $data;
347  }
348 
349  return $this->firstName;
350  }
351 
358  public function getLastName()
359  {
360  if (is_null($this->lastName)) {
362  $data = $this->raw(self::FIELD_LAST_NAME);
363  if (is_null($data)) {
364  return null;
365  }
366  $this->lastName = (string) $data;
367  }
368 
369  return $this->lastName;
370  }
371 
378  public function getStreetName()
379  {
380  if (is_null($this->streetName)) {
382  $data = $this->raw(self::FIELD_STREET_NAME);
383  if (is_null($data)) {
384  return null;
385  }
386  $this->streetName = (string) $data;
387  }
388 
389  return $this->streetName;
390  }
391 
398  public function getStreetNumber()
399  {
400  if (is_null($this->streetNumber)) {
402  $data = $this->raw(self::FIELD_STREET_NUMBER);
403  if (is_null($data)) {
404  return null;
405  }
406  $this->streetNumber = (string) $data;
407  }
408 
409  return $this->streetNumber;
410  }
411 
418  public function getAdditionalStreetInfo()
419  {
420  if (is_null($this->additionalStreetInfo)) {
422  $data = $this->raw(self::FIELD_ADDITIONAL_STREET_INFO);
423  if (is_null($data)) {
424  return null;
425  }
426  $this->additionalStreetInfo = (string) $data;
427  }
428 
430  }
431 
438  public function getPostalCode()
439  {
440  if (is_null($this->postalCode)) {
442  $data = $this->raw(self::FIELD_POSTAL_CODE);
443  if (is_null($data)) {
444  return null;
445  }
446  $this->postalCode = (string) $data;
447  }
448 
449  return $this->postalCode;
450  }
451 
458  public function getCity()
459  {
460  if (is_null($this->city)) {
462  $data = $this->raw(self::FIELD_CITY);
463  if (is_null($data)) {
464  return null;
465  }
466  $this->city = (string) $data;
467  }
468 
469  return $this->city;
470  }
471 
478  public function getRegion()
479  {
480  if (is_null($this->region)) {
482  $data = $this->raw(self::FIELD_REGION);
483  if (is_null($data)) {
484  return null;
485  }
486  $this->region = (string) $data;
487  }
488 
489  return $this->region;
490  }
491 
498  public function getState()
499  {
500  if (is_null($this->state)) {
502  $data = $this->raw(self::FIELD_STATE);
503  if (is_null($data)) {
504  return null;
505  }
506  $this->state = (string) $data;
507  }
508 
509  return $this->state;
510  }
511 
518  public function getCompany()
519  {
520  if (is_null($this->company)) {
522  $data = $this->raw(self::FIELD_COMPANY);
523  if (is_null($data)) {
524  return null;
525  }
526  $this->company = (string) $data;
527  }
528 
529  return $this->company;
530  }
531 
538  public function getDepartment()
539  {
540  if (is_null($this->department)) {
542  $data = $this->raw(self::FIELD_DEPARTMENT);
543  if (is_null($data)) {
544  return null;
545  }
546  $this->department = (string) $data;
547  }
548 
549  return $this->department;
550  }
551 
558  public function getBuilding()
559  {
560  if (is_null($this->building)) {
562  $data = $this->raw(self::FIELD_BUILDING);
563  if (is_null($data)) {
564  return null;
565  }
566  $this->building = (string) $data;
567  }
568 
569  return $this->building;
570  }
571 
578  public function getApartment()
579  {
580  if (is_null($this->apartment)) {
582  $data = $this->raw(self::FIELD_APARTMENT);
583  if (is_null($data)) {
584  return null;
585  }
586  $this->apartment = (string) $data;
587  }
588 
589  return $this->apartment;
590  }
591 
598  public function getPOBox()
599  {
600  if (is_null($this->pOBox)) {
602  $data = $this->raw(self::FIELD_P_O_BOX);
603  if (is_null($data)) {
604  return null;
605  }
606  $this->pOBox = (string) $data;
607  }
608 
609  return $this->pOBox;
610  }
611 
618  public function getPhone()
619  {
620  if (is_null($this->phone)) {
622  $data = $this->raw(self::FIELD_PHONE);
623  if (is_null($data)) {
624  return null;
625  }
626  $this->phone = (string) $data;
627  }
628 
629  return $this->phone;
630  }
631 
638  public function getMobile()
639  {
640  if (is_null($this->mobile)) {
642  $data = $this->raw(self::FIELD_MOBILE);
643  if (is_null($data)) {
644  return null;
645  }
646  $this->mobile = (string) $data;
647  }
648 
649  return $this->mobile;
650  }
651 
658  public function getEmail()
659  {
660  if (is_null($this->email)) {
662  $data = $this->raw(self::FIELD_EMAIL);
663  if (is_null($data)) {
664  return null;
665  }
666  $this->email = (string) $data;
667  }
668 
669  return $this->email;
670  }
671 
678  public function getFax()
679  {
680  if (is_null($this->fax)) {
682  $data = $this->raw(self::FIELD_FAX);
683  if (is_null($data)) {
684  return null;
685  }
686  $this->fax = (string) $data;
687  }
688 
689  return $this->fax;
690  }
691 
698  public function getAdditionalAddressInfo()
699  {
700  if (is_null($this->additionalAddressInfo)) {
702  $data = $this->raw(self::FIELD_ADDITIONAL_ADDRESS_INFO);
703  if (is_null($data)) {
704  return null;
705  }
706  $this->additionalAddressInfo = (string) $data;
707  }
708 
710  }
711 
718  public function getExternalId()
719  {
720  if (is_null($this->externalId)) {
722  $data = $this->raw(self::FIELD_EXTERNAL_ID);
723  if (is_null($data)) {
724  return null;
725  }
726  $this->externalId = (string) $data;
727  }
728 
729  return $this->externalId;
730  }
731 
732 
736  public function setId(?string $id): void
737  {
738  $this->id = $id;
739  }
740 
744  public function setKey(?string $key): void
745  {
746  $this->key = $key;
747  }
748 
752  public function setCountry(?string $country): void
753  {
754  $this->country = $country;
755  }
756 
760  public function setTitle(?string $title): void
761  {
762  $this->title = $title;
763  }
764 
768  public function setSalutation(?string $salutation): void
769  {
770  $this->salutation = $salutation;
771  }
772 
776  public function setFirstName(?string $firstName): void
777  {
778  $this->firstName = $firstName;
779  }
780 
784  public function setLastName(?string $lastName): void
785  {
786  $this->lastName = $lastName;
787  }
788 
792  public function setStreetName(?string $streetName): void
793  {
794  $this->streetName = $streetName;
795  }
796 
800  public function setStreetNumber(?string $streetNumber): void
801  {
802  $this->streetNumber = $streetNumber;
803  }
804 
808  public function setAdditionalStreetInfo(?string $additionalStreetInfo): void
809  {
810  $this->additionalStreetInfo = $additionalStreetInfo;
811  }
812 
816  public function setPostalCode(?string $postalCode): void
817  {
818  $this->postalCode = $postalCode;
819  }
820 
824  public function setCity(?string $city): void
825  {
826  $this->city = $city;
827  }
828 
832  public function setRegion(?string $region): void
833  {
834  $this->region = $region;
835  }
836 
840  public function setState(?string $state): void
841  {
842  $this->state = $state;
843  }
844 
848  public function setCompany(?string $company): void
849  {
850  $this->company = $company;
851  }
852 
856  public function setDepartment(?string $department): void
857  {
858  $this->department = $department;
859  }
860 
864  public function setBuilding(?string $building): void
865  {
866  $this->building = $building;
867  }
868 
872  public function setApartment(?string $apartment): void
873  {
874  $this->apartment = $apartment;
875  }
876 
880  public function setPOBox(?string $pOBox): void
881  {
882  $this->pOBox = $pOBox;
883  }
884 
888  public function setPhone(?string $phone): void
889  {
890  $this->phone = $phone;
891  }
892 
896  public function setMobile(?string $mobile): void
897  {
898  $this->mobile = $mobile;
899  }
900 
904  public function setEmail(?string $email): void
905  {
906  $this->email = $email;
907  }
908 
912  public function setFax(?string $fax): void
913  {
914  $this->fax = $fax;
915  }
916 
920  public function setAdditionalAddressInfo(?string $additionalAddressInfo): void
921  {
922  $this->additionalAddressInfo = $additionalAddressInfo;
923  }
924 
928  public function setExternalId(?string $externalId): void
929  {
930  $this->externalId = $externalId;
931  }
932 }
__construct(?string $id=null, ?string $key=null, ?string $country=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 $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)
setAdditionalAddressInfo(?string $additionalAddressInfo)
setAdditionalStreetInfo(?string $additionalStreetInfo)