<?php
namespace App\Entity;
use App\Validator as AppAssert;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Embeddable
*/
class Address
{
/**
* @var string
*
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Length(max="255")
* @Assert\NotBlank()
* @AppAssert\Geocodable()
*/
private $request;
/**
* @var string
*
* @ORM\Column(type="json", nullable=true)
*/
private $response;
/**
* @var string
*
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Length(max="255")
*/
private $number;
/**
* @var string
*
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Length(max="255")
*/
private $street;
/**
* @var string
*
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Length(max="255")
*/
private $city;
/**
* @var string
*
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Length(max="255")
*/
private $administrativeLevel1Short;
/**
* @var string
*
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Length(max="255")
*/
private $administrativeLevel1Long;
/**
* @var string
*
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Length(max="255")
*/
private $administrativeLevel2;
/**
* @var string
*
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Length(max="255")
*/
private $countryShort;
/**
* @var string
*
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Length(max="255")
*/
private $countryLong;
/**
* @var string
*
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Length(max="255")
*/
private $postalCode;
/**
* @var string
*
* @ORM\Column(type="decimal", precision=11, scale=7, nullable=true)
*/
private $latitude;
/**
* @var string
*
* @ORM\Column(type="decimal", precision=11, scale=7, nullable=true)
*/
private $longitude;
public function clean()
{
$this->request = null;
$this->response = null;
$this->number = null;
$this->street = null;
$this->city = null;
$this->administrativeLevel1Short = null;
$this->administrativeLevel1Long = null;
$this->administrativeLevel2 = null;
$this->countryShort = null;
$this->countryLong = null;
$this->postalCode = null;
$this->latitude = null;
$this->longitude = null;
return $this;
}
public function getRequest(): ?string
{
return $this->request;
}
public function setRequest(?string $request): self
{
$this->request = $request;
return $this;
}
public function getResponse()
{
return $this->response;
}
public function setResponse($response): self
{
$this->response = $response;
return $this;
}
public function getNumber(): ?string
{
return $this->number;
}
public function setNumber(?string $number): self
{
$this->number = $number;
return $this;
}
public function getStreet(): ?string
{
return $this->street;
}
public function setStreet(?string $street): self
{
$this->street = $street;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): self
{
$this->city = $city;
return $this;
}
public function getAdministrativeLevel1Short(): ?string
{
return $this->administrativeLevel1Short;
}
public function setAdministrativeLevel1Short(?string $administrativeLevel1Short): self
{
$this->administrativeLevel1Short = $administrativeLevel1Short;
return $this;
}
public function getAdministrativeLevel1Long(): ?string
{
return $this->administrativeLevel1Long;
}
public function setAdministrativeLevel1Long(?string $administrativeLevel1Long): self
{
$this->administrativeLevel1Long = $administrativeLevel1Long;
return $this;
}
public function getAdministrativeLevel2(): ?string
{
return $this->administrativeLevel2;
}
public function setAdministrativeLevel2(?string $administrativeLevel2): self
{
$this->administrativeLevel2 = $administrativeLevel2;
return $this;
}
public function getCountryShort(): ?string
{
return $this->countryShort;
}
public function setCountryShort(?string $countryShort): self
{
$this->countryShort = $countryShort;
return $this;
}
public function getCountryLong(): ?string
{
return $this->countryLong;
}
public function setCountryLong(?string $countryLong): self
{
$this->countryLong = $countryLong;
return $this;
}
public function getPostalCode(): ?string
{
return $this->postalCode;
}
public function setPostalCode(?string $postalCode): self
{
$this->postalCode = $postalCode;
return $this;
}
public function getLatitude()
{
return $this->latitude;
}
public function setLatitude($latitude): self
{
$this->latitude = $latitude;
return $this;
}
public function getLongitude()
{
return $this->longitude;
}
public function setLongitude($longitude): self
{
$this->longitude = $longitude;
return $this;
}
/**
* Return true if all properties == null|[].
*
* @return bool
*/
public function isNull()
{
return empty(array_filter(get_object_vars($this)));
}
public function __toString(): string
{
$parts = [];
if (null !== $this->city) {
$parts[] = $this->city;
}
if (null !== $this->administrativeLevel1Short) {
$parts[] = $this->administrativeLevel1Short;
}
return implode(', ', $parts);
}
}