src/Entity/CustomerAddress.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\CustomerAddressRepository")
  6.  */
  7. class CustomerAddress
  8. {
  9.     /**
  10.      * @ORM\Id()
  11.      * @ORM\GeneratedValue()
  12.      * @ORM\Column(type="bigint")
  13.      */
  14.     private $id;
  15.     /**
  16.      * @ORM\Column(type="string", length=255)
  17.      */
  18.     private $address_line_1;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $address_line_2;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $city;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      */
  30.     private $state_province;
  31.     /**
  32.      * @ORM\Column(type="string", length=32)
  33.      */
  34.     private $postal_code;
  35.     /**
  36.      * @ORM\Column(type="string", length=255)
  37.      */
  38.     private $country;
  39.     /**
  40.      * @ORM\Column(type="datetime")
  41.      */
  42.     private $modified_at;
  43.     /**
  44.      * @ORM\Column(type="datetime")
  45.      */
  46.     private $created_at;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity="App\Entity\Customer", inversedBy="addresses")
  49.      * @ORM\JoinColumn(nullable=false)
  50.      */
  51.     private $customer;
  52.     /**
  53.      * @ORM\Column(type="integer")
  54.      */
  55.     private $status;
  56.     /**
  57.      * @ORM\Column(type="decimal", precision=11, scale=8)
  58.      */
  59.     private $geo_lat;
  60.     /**
  61.      * @ORM\Column(type="decimal", precision=11, scale=8)
  62.      */
  63.     private $geo_lng;
  64.     /**
  65.      * @ORM\Column(type="string", length=255)
  66.      */
  67.     private $title;
  68.     /**
  69.      * @ORM\Column(type="text")
  70.      */
  71.     private $description;
  72.     
  73.     public function __construct ()
  74.     {
  75.         $this->title "Address";
  76.         $this->description "";
  77.         $this->address_line_1 "";
  78.         $this->address_line_2 "";
  79.         $this->city "";
  80.         $this->state_province "";
  81.         $this->postal_code "";
  82.         $this->country "";
  83.         $this->status 1;
  84.         $this->geo_lat 0;
  85.         $this->geo_lng 0;
  86.         
  87.         $this->modified_at = new \DateTime("now");
  88.         $this->created_at = new \DateTime("now");
  89.     }
  90.     public function getId()
  91.     {
  92.         return $this->id;
  93.     }
  94.     public function getAddressLine1(): ?string
  95.     {
  96.         return $this->address_line_1;
  97.     }
  98.     public function setAddressLine1(string $address_line_1 null): self
  99.     {
  100.         $this->address_line_1 $address_line_1 $address_line_1 "";
  101.         return $this;
  102.     }
  103.     public function getAddressLine2(): ?string
  104.     {
  105.         return $this->address_line_2;
  106.     }
  107.     public function setAddressLine2(?string $address_line_2 null): self
  108.     {
  109.         $this->address_line_2 $address_line_2 $address_line_2 "";
  110.         return $this;
  111.     }
  112.     public function getCity(): ?string
  113.     {
  114.         return $this->city;
  115.     }
  116.     public function setCity(string $city null): self
  117.     {
  118.         $this->city $city $city "";
  119.         return $this;
  120.     }
  121.     public function getStateProvince(): ?string
  122.     {
  123.         return $this->state_province;
  124.     }
  125.     public function setStateProvince(string $state_province null): self
  126.     {
  127.         $this->state_province $state_province $state_province "";
  128.         return $this;
  129.     }
  130.     public function getPostalCode(): ?string
  131.     {
  132.         return $this->postal_code;
  133.     }
  134.     public function setPostalCode(string $postal_code null): self
  135.     {
  136.         $this->postal_code $postal_code $postal_code "";
  137.         return $this;
  138.     }
  139.     public function getCountry(): ?string
  140.     {
  141.         return $this->country;
  142.     }
  143.     public function setCountry(string $country null): self
  144.     {
  145.         $this->country $country $country "";
  146.         return $this;
  147.     }
  148.     public function getModifiedAt(): ?\DateTimeInterface
  149.     {
  150.         return $this->modified_at;
  151.     }
  152.     public function setModifiedAt(\DateTimeInterface $modified_at): self
  153.     {
  154.         $this->modified_at $modified_at;
  155.         return $this;
  156.     }
  157.     public function getCreatedAt(): ?\DateTimeInterface
  158.     {
  159.         return $this->created_at;
  160.     }
  161.     public function setCreatedAt(\DateTimeInterface $created_at): self
  162.     {
  163.         $this->created_at $created_at;
  164.         return $this;
  165.     }
  166.     public function getCustomer(): ?Customer
  167.     {
  168.         return $this->customer;
  169.     }
  170.     public function setCustomer(?Customer $customer): self
  171.     {
  172.         $this->customer $customer;
  173.         return $this;
  174.     }
  175.     public function getStatus(): ?int
  176.     {
  177.         return $this->status;
  178.     }
  179.     public function setStatus(int $status): self
  180.     {
  181.         $this->status $status;
  182.         return $this;
  183.     }
  184.     public function getGeoLat()
  185.     {
  186.         return $this->geo_lat;
  187.     }
  188.     public function setGeoLat($geo_lat null): self
  189.     {
  190.         $this->geo_lat $geo_lat $geo_lat "";
  191.         return $this;
  192.     }
  193.     public function getGeoLng()
  194.     {
  195.         return $this->geo_lng;
  196.     }
  197.     public function setGeoLng($geo_lng null): self
  198.     {
  199.         $this->geo_lng $geo_lng $geo_lng "";
  200.         return $this;
  201.     }
  202.     
  203.     public function getTitle(): ?string
  204.     {
  205.         return $this->title;
  206.     }
  207.     public function setTitle(string $title null): self
  208.     {
  209.         $this->title $title $title "";
  210.         return $this;
  211.     }
  212.     public function getDescription(): ?string
  213.     {
  214.         return $this->description;
  215.     }
  216.     public function setDescription(string $description null): self
  217.     {
  218.         $this->description $description $description "";
  219.         return $this;
  220.     }
  221.     
  222.     public function __toString ()
  223.     {
  224.         return trim(implode(" ", array (
  225.             $this->address_line_1,
  226.             $this->address_line_2,
  227.             "{$this->city},",
  228.             $this->state_province,
  229.             $this->postal_code,
  230.             $this->country
  231.         )));
  232.     }
  233. }