src/Entity/Adresse.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Symfony\Component\Validator\Constraints as Assert;
  4. use App\Repository\AdresseRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=AdresseRepository::class)
  8.  */
  9. class Adresse
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255)
  19.      */
  20.     private $lastName;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private $firstName;
  25.     /**
  26.      * @Assert\NotBlank()
  27.      * @ORM\Column(type="string", length=255 , nullable=true)
  28.      */
  29.     private $city;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $codePostal;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      */
  37.     private $tel;
  38.     /**
  39.      * @Assert\NotBlank()
  40.      * @ORM\Column(type="string", length=255, nullable=true)
  41.      */
  42.     private $rue;
  43.     /**
  44.      * @ORM\OneToOne(targetEntity=User::class, mappedBy="adresse", cascade={"persist", "remove"})
  45.      */
  46.     private $user;
  47.     /**
  48.      * @Assert\NotBlank()
  49.      * @ORM\Column(type="string", length=255, nullable=true)
  50.      */
  51.     private $pays;
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getLastName(): ?string
  57.     {
  58.         return $this->lastName;
  59.     }
  60.     public function setLastName(string $lastName): self
  61.     {
  62.         $this->lastName $lastName;
  63.         return $this;
  64.     }
  65.     public function getFirstName(): ?string
  66.     {
  67.         return $this->firstName;
  68.     }
  69.     public function setFirstName(string $firstName): self
  70.     {
  71.         $this->firstName $firstName;
  72.         return $this;
  73.     }
  74.     public function getCity(): ?string
  75.     {
  76.         return $this->city;
  77.     }
  78.     public function setCity(string $city): self
  79.     {
  80.         $this->city $city;
  81.         return $this;
  82.     }
  83.     public function getCodePostal(): ?string
  84.     {
  85.         return $this->codePostal;
  86.     }
  87.     public function setCodePostal(?string $codePostal): self
  88.     {
  89.         $this->codePostal $codePostal;
  90.         return $this;
  91.     }
  92.     public function getTel(): ?string
  93.     {
  94.         return $this->tel;
  95.     }
  96.     public function setTel(string $tel): self
  97.     {
  98.         $this->tel $tel;
  99.         return $this;
  100.     }
  101.     public function getRue(): ?string
  102.     {
  103.         return $this->rue;
  104.     }
  105.     public function setRue(?string $rue): self
  106.     {
  107.         $this->rue $rue;
  108.         return $this;
  109.     }
  110.     public function getUser(): ?User
  111.     {
  112.         return $this->user;
  113.     }
  114.     public function setUser(?User $user): self
  115.     {
  116.         // unset the owning side of the relation if necessary
  117.         if ($user === null && $this->user !== null) {
  118.             $this->user->setAdresse(null);
  119.         }
  120.         // set the owning side of the relation if necessary
  121.         if ($user !== null && $user->getAdresse() !== $this) {
  122.             $user->setAdresse($this);
  123.         }
  124.         $this->user $user;
  125.         return $this;
  126.     }
  127.     public function getPays(): ?string
  128.     {
  129.         return $this->pays;
  130.     }
  131.     public function setPays(string $pays): self
  132.     {
  133.         $this->pays $pays;
  134.         return $this;
  135.     }
  136. }