<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\CustomerAddressRepository")
*/
class CustomerAddress
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="bigint")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $address_line_1;
/**
* @ORM\Column(type="string", length=255)
*/
private $address_line_2;
/**
* @ORM\Column(type="string", length=255)
*/
private $city;
/**
* @ORM\Column(type="string", length=255)
*/
private $state_province;
/**
* @ORM\Column(type="string", length=32)
*/
private $postal_code;
/**
* @ORM\Column(type="string", length=255)
*/
private $country;
/**
* @ORM\Column(type="datetime")
*/
private $modified_at;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Customer", inversedBy="addresses")
* @ORM\JoinColumn(nullable=false)
*/
private $customer;
/**
* @ORM\Column(type="integer")
*/
private $status;
/**
* @ORM\Column(type="decimal", precision=11, scale=8)
*/
private $geo_lat;
/**
* @ORM\Column(type="decimal", precision=11, scale=8)
*/
private $geo_lng;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\Column(type="text")
*/
private $description;
public function __construct ()
{
$this->title = "Address";
$this->description = "";
$this->address_line_1 = "";
$this->address_line_2 = "";
$this->city = "";
$this->state_province = "";
$this->postal_code = "";
$this->country = "";
$this->status = 1;
$this->geo_lat = 0;
$this->geo_lng = 0;
$this->modified_at = new \DateTime("now");
$this->created_at = new \DateTime("now");
}
public function getId()
{
return $this->id;
}
public function getAddressLine1(): ?string
{
return $this->address_line_1;
}
public function setAddressLine1(string $address_line_1 = null): self
{
$this->address_line_1 = $address_line_1 ? $address_line_1 : "";
return $this;
}
public function getAddressLine2(): ?string
{
return $this->address_line_2;
}
public function setAddressLine2(?string $address_line_2 = null): self
{
$this->address_line_2 = $address_line_2 ? $address_line_2 : "";
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(string $city = null): self
{
$this->city = $city ? $city : "";
return $this;
}
public function getStateProvince(): ?string
{
return $this->state_province;
}
public function setStateProvince(string $state_province = null): self
{
$this->state_province = $state_province ? $state_province : "";
return $this;
}
public function getPostalCode(): ?string
{
return $this->postal_code;
}
public function setPostalCode(string $postal_code = null): self
{
$this->postal_code = $postal_code ? $postal_code : "";
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(string $country = null): self
{
$this->country = $country ? $country : "";
return $this;
}
public function getModifiedAt(): ?\DateTimeInterface
{
return $this->modified_at;
}
public function setModifiedAt(\DateTimeInterface $modified_at): self
{
$this->modified_at = $modified_at;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getCustomer(): ?Customer
{
return $this->customer;
}
public function setCustomer(?Customer $customer): self
{
$this->customer = $customer;
return $this;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(int $status): self
{
$this->status = $status;
return $this;
}
public function getGeoLat()
{
return $this->geo_lat;
}
public function setGeoLat($geo_lat = null): self
{
$this->geo_lat = $geo_lat ? $geo_lat : "";
return $this;
}
public function getGeoLng()
{
return $this->geo_lng;
}
public function setGeoLng($geo_lng = null): self
{
$this->geo_lng = $geo_lng ? $geo_lng : "";
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title = null): self
{
$this->title = $title ? $title : "";
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description = null): self
{
$this->description = $description ? $description : "";
return $this;
}
public function __toString ()
{
return trim(implode(" ", array (
$this->address_line_1,
$this->address_line_2,
"{$this->city},",
$this->state_province,
$this->postal_code,
$this->country
)));
}
}