src/Entity/Address.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AddressRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=AddressRepository::class)
  7.  */
  8. class Address
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="addresses")
  18.      * @ORM\JoinColumn(nullable=false)
  19.      */
  20.     private $user;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private $name;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      */
  28.     private $firstname;
  29.     /**
  30.      * @ORM\Column(type="string", length=255)
  31.      */
  32.     private $lastname;
  33.     /**
  34.      * @ORM\Column(type="string", length=255)
  35.      */
  36.     private $company;
  37.     /**
  38.      * @ORM\Column(type="string", length=255)
  39.      */
  40.     private $address;
  41.     /**
  42.      * @ORM\Column(type="string", length=255)
  43.      */
  44.     private $postal;
  45.     /**
  46.      * @ORM\Column(type="string", length=255)
  47.      */
  48.     private $city;
  49.     /**
  50.      * @ORM\Column(type="string", length=255)
  51.      */
  52.     private $country;
  53.     /**
  54.      * @ORM\Column(type="string", length=255)
  55.      */
  56.     private $phone;
  57.     public function getId(): ?int
  58.     {
  59.         return $this->id;
  60.     }
  61.     public function getUser(): ?User
  62.     {
  63.         return $this->user;
  64.     }
  65.     public function setUser(?User $user): self
  66.     {
  67.         $this->user $user;
  68.         return $this;
  69.     }
  70.     public function getName(): ?string
  71.     {
  72.         return $this->name;
  73.     }
  74.     public function setName(string $name): self
  75.     {
  76.         $this->name $name;
  77.         return $this;
  78.     }
  79.     public function getFirstname(): ?string
  80.     {
  81.         return $this->firstname;
  82.     }
  83.     public function setFirstname(string $firstname): self
  84.     {
  85.         $this->firstname $firstname;
  86.         return $this;
  87.     }
  88.     public function getLastname(): ?string
  89.     {
  90.         return $this->lastname;
  91.     }
  92.     public function setLastname(string $lastname): self
  93.     {
  94.         $this->lastname $lastname;
  95.         return $this;
  96.     }
  97.     public function getCompany(): ?string
  98.     {
  99.         return $this->company;
  100.     }
  101.     public function setCompany(string $company): self
  102.     {
  103.         $this->company $company;
  104.         return $this;
  105.     }
  106.     public function getAddress(): ?string
  107.     {
  108.         return $this->address;
  109.     }
  110.     public function setAddress(string $address): self
  111.     {
  112.         $this->address $address;
  113.         return $this;
  114.     }
  115.     public function getPostal(): ?string
  116.     {
  117.         return $this->postal;
  118.     }
  119.     public function setPostal(string $postal): self
  120.     {
  121.         $this->postal $postal;
  122.         return $this;
  123.     }
  124.     public function getCity(): ?string
  125.     {
  126.         return $this->city;
  127.     }
  128.     public function setCity(string $city): self
  129.     {
  130.         $this->city $city;
  131.         return $this;
  132.     }
  133.     public function getCountry(): ?string
  134.     {
  135.         return $this->country;
  136.     }
  137.     public function setCountry(string $country): self
  138.     {
  139.         $this->country $country;
  140.         return $this;
  141.     }
  142.     public function getPhone(): ?string
  143.     {
  144.         return $this->phone;
  145.     }
  146.     public function setPhone(string $phone): self
  147.     {
  148.         $this->phone $phone;
  149.         return $this;
  150.     }
  151.     public function __toString(){
  152.         return $this->getName().'[br]'.$this->getAddress().'[br]'.$this->getCity().' - '.$this->getCountry();
  153.     }
  154. }