src/Entity/Addresse.php line 7

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AddresseRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassAddresseRepository::class)]
  6. class Addresse
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column]
  11.     private ?int $id null;
  12.     #[ORM\Column(nullabletrue)]
  13.     private ?bool $default_addresse null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $full_addresse null;
  16.     #[ORM\Column(nullabletrue)]
  17.     private ?int $code_postale null;
  18.     #[ORM\Column(length150nullabletrue)]
  19.     private ?string $ville null;
  20.     #[ORM\Column(length50nullabletrue)]
  21.     private ?string $label null;
  22.     #[ORM\ManyToOne(inversedBy'addresses')]
  23.     private ?User $user null;
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function setId(int $id): self
  29.     {
  30.         return $this;
  31.     }
  32.     public function isDefaultAddresse(): ?bool
  33.     {
  34.         return $this->default_addresse;
  35.     }
  36.     public function setDefaultAddresse(?bool $default_addresse): self
  37.     {
  38.         $this->default_addresse $default_addresse;
  39.         return $this;
  40.     }
  41.     public function getFullAddresse(): ?string
  42.     {
  43.         return $this->full_addresse;
  44.     }
  45.     public function setFullAddresse(string $full_addresse): self
  46.     {
  47.         $this->full_addresse $full_addresse;
  48.         return $this;
  49.     }
  50.     public function getCodePostale(): ?int
  51.     {
  52.         return $this->code_postale;
  53.     }
  54.     public function setCodePostale(int $code_postale): self
  55.     {
  56.         $this->code_postale $code_postale;
  57.         return $this;
  58.     }
  59.     public function getVille(): ?string
  60.     {
  61.         return $this->ville;
  62.     }
  63.     public function setVille(string $ville): self
  64.     {
  65.         $this->ville $ville;
  66.         return $this;
  67.     }
  68.     public function getLabel(): ?string
  69.     {
  70.         return $this->label;
  71.     }
  72.     public function setLabel(?string $label): self
  73.     {
  74.         $this->label $label;
  75.         return $this;
  76.     }
  77.     public function getLabelIcon(): string
  78.     {
  79.         return match($this->label) {
  80.             'Home'    => '🏠',
  81.             'Work'    => '💼',
  82.             'Hangout' => '🎯',
  83.             default   => '📍',
  84.         };
  85.     }
  86.     public function getUser(): ?User
  87.     {
  88.         return $this->user;
  89.     }
  90.     public function setUser(?User $user): self
  91.     {
  92.         $this->user $user;
  93.         return $this;
  94.     }
  95. }