src/Entity/Quartiers.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\QuartiersRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassQuartiersRepository::class)]
  8. class Quartiers
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column()]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $code null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $slug null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $nom null;
  20.     #[ORM\ManyToOne(inversedBy'quartiers')]
  21.     #[ORM\JoinColumn(nullablefalse)]
  22.     private ?Villes $ville null;
  23.     #[ORM\Column(nullabletrue)]
  24.     private ?bool $isStatus null;
  25.     #[ORM\OneToMany(mappedBy'quartier'targetEntityImmeubles::class)]
  26.     private Collection $immeubles;
  27.     public function __construct()
  28.     {
  29.         $this->immeubles = new ArrayCollection();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getCode(): ?string
  36.     {
  37.         return $this->code;
  38.     }
  39.     public function setCode(string $code): self
  40.     {
  41.         $this->code $code;
  42.         return $this;
  43.     }
  44.     public function getSlug(): ?string
  45.     {
  46.         return $this->slug;
  47.     }
  48.     public function setSlug(string $slug): self
  49.     {
  50.         $this->slug $slug;
  51.         return $this;
  52.     }
  53.     public function getNom(): ?string
  54.     {
  55.         return $this->nom;
  56.     }
  57.     public function setNom(string $nom): self
  58.     {
  59.         $this->nom $nom;
  60.         return $this;
  61.     }
  62.     public function getVille(): ?Villes
  63.     {
  64.         return $this->ville;
  65.     }
  66.     public function setVille(?Villes $ville): self
  67.     {
  68.         $this->ville $ville;
  69.         return $this;
  70.     }
  71.     public function isIsStatus(): ?bool
  72.     {
  73.         return $this->isStatus;
  74.     }
  75.     public function setIsStatus(?bool $isStatus): self
  76.     {
  77.         $this->isStatus $isStatus;
  78.         return $this;
  79.     }
  80.     /**
  81.      * @return Collection<int, Immeubles>
  82.      */
  83.     public function getImmeubles(): Collection
  84.     {
  85.         return $this->immeubles;
  86.     }
  87.     public function addImmeuble(Immeubles $immeuble): self
  88.     {
  89.         if (!$this->immeubles->contains($immeuble)) {
  90.             $this->immeubles[] = $immeuble;
  91.             $immeuble->setQuartier($this);
  92.         }
  93.         return $this;
  94.     }
  95.     public function removeImmeuble(Immeubles $immeuble): self
  96.     {
  97.         if ($this->immeubles->removeElement($immeuble)) {
  98.             // set the owning side to null (unless already changed)
  99.             if ($immeuble->getQuartier() === $this) {
  100.                 $immeuble->setQuartier(null);
  101.             }
  102.         }
  103.         return $this;
  104.     }
  105. }