. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ namespace Espo\Core\Field\Address; use Espo\Core\Field\Address; /** * An address value builder. */ class AddressBuilder { private ?string $street; private ?string $city; private ?string $country; private ?string $state; private ?string $postalCode; public function clone(Address $address): self { $this->setStreet($address->getStreet()); $this->setCity($address->getCity()); $this->setCountry($address->getCountry()); $this->setState($address->getState()); $this->setPostalCode($address->getPostalCode()); return $this; } public function setStreet(?string $street): self { $this->street = $street; return $this; } public function setCity(?string $city): self { $this->city = $city; return $this; } public function setCountry(?string $country): self { $this->country = $country; return $this; } public function setState(?string $state): self { $this->state = $state; return $this; } public function setPostalCode(?string $postalCode): self { $this->postalCode = $postalCode; return $this; } public function build(): Address { return new Address( $this->country, $this->state, $this->city, $this->street, $this->postalCode ); } }