displayName; } public function getId(): Uuid { return $this->id; } public function setId(Uuid $id): self { $this->id = $id; return $this; } public function getAddress(): string { return $this->address; } public function setAddress(string $address): self { $this->address = $address; return $this; } public function getAddressSupplement(): ?string { return $this->addressSupplement; } public function setAddressSupplement(?string $addressSupplement): Address { $this->addressSupplement = $addressSupplement; return $this; } public function getDisplayName(): ?string { return $this->displayName; } public function setDisplayName(?string $displayName): self { $this->displayName = $displayName; return $this; } public function getStreetNumber(): string { return $this->streetNumber; } public function setStreetNumber(string $streetNumber): self { $this->streetNumber = $streetNumber; return $this; } public function getStreetName(): string { return $this->streetName; } public function setStreetName(string $streetName): self { $this->streetName = $streetName; return $this; } public function getLocality(): string { return $this->locality; } public function hasLocality(): bool { return $this->locality !== ''; } public function setLocality(string $locality): self { $this->locality = $locality; return $this; } public function getSubLocality(): ?string { return $this->subLocality; } public function setSubLocality(?string $subLocality): self { $this->subLocality = $subLocality; return $this; } public function getPostalCode(): string { return $this->postalCode; } public function setPostalCode(string $postalCode): self { $this->postalCode = $postalCode; return $this; } public function getCountry(): string { return $this->country; } public function setCountry(string $country): self { $this->country = $country; return $this; } public function getLatitude(): string { return $this->latitude; } public function setLatitude(string $latitude): self { $this->latitude = $latitude; return $this; } public function getLongitude(): string { return $this->longitude; } public function setLongitude(string $longitude): self { $this->longitude = $longitude; return $this; } public function getProvidedBy(): string { return $this->providedBy; } public function setProvidedBy(string $providedBy): Address { $this->providedBy = $providedBy; return $this; } public function getAttribution(): string { return $this->attribution; } public function setAttribution(string $attribution): Address { $this->attribution = $attribution; return $this; } public function getOsmType(): ?string { return $this->osmType; } public function setOsmType(?string $osmType): Address { $this->osmType = $osmType; return $this; } public function getOsmId(): int { return $this->osmId; } public function setOsmId(int $osmId): Address { $this->osmId = $osmId; return $this; } // End of basic setters/getters ———————————————————————————————————————————— /** * Format a full address with the user input (for address update step2). */ public function getFullAddress(): string { $addressSupplement = u($this->addressSupplement)->isEmpty() ? '' : ', '.$this->addressSupplement; return $this->address.$addressSupplement.', '.$this->postalCode.', '.$this->locality.', '.$this->country; } /** * Override the properties of the old address. */ public function setFromAddressUpdateStep1(Address $newAddress): self { $this->setAddress($newAddress->getAddress()); $this->setAddressSupplement($newAddress->getAddressSupplement()); $this->setPostalCode($newAddress->getPostalCode()); $this->setLocality($newAddress->getLocality()); $this->setCountry($newAddress->getCountry()); return $this; } public function getSubAndLocality(): string { if (u($this->subLocality)->isEmpty()) { return $this->locality; } return $this->locality.' ('.$this->subLocality.')'; } }