src/Entity/Villes.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\VillesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassVillesRepository::class)]
  8. class Villes
  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\Column(nullabletrue)]
  21.     private ?bool $status null;
  22.     #[ORM\OneToMany(mappedBy'ville'targetEntityQuartiers::class)]
  23.     private Collection $quartiers;
  24.     #[ORM\OneToMany(mappedBy'ville'targetEntityImmeubles::class)]
  25.     private Collection $immeubles;
  26.     #[ORM\OneToMany(mappedBy'ville'targetEntityVehicules::class)]
  27.     private Collection $vehicules;
  28.     public function __construct()
  29.     {
  30.         $this->quartiers = new ArrayCollection();
  31.         $this->immeubles = new ArrayCollection();
  32.         $this->vehicules = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getCode(): ?string
  39.     {
  40.         return $this->code;
  41.     }
  42.     public function setCode(string $code): self
  43.     {
  44.         $this->code $code;
  45.         return $this;
  46.     }
  47.     public function getSlug(): ?string
  48.     {
  49.         return $this->slug;
  50.     }
  51.     public function setSlug(string $slug): self
  52.     {
  53.         $this->slug $slug;
  54.         return $this;
  55.     }
  56.     public function getNom(): ?string
  57.     {
  58.         return $this->nom;
  59.     }
  60.     public function setNom(string $nom): self
  61.     {
  62.         $this->nom $nom;
  63.         return $this;
  64.     }
  65.     public function isStatus(): ?bool
  66.     {
  67.         return $this->status;
  68.     }
  69.     public function setStatus(?bool $status): self
  70.     {
  71.         $this->status $status;
  72.         return $this;
  73.     }
  74.     /**
  75.      * @return Collection<int, Quartiers>
  76.      */
  77.     public function getQuartiers(): Collection
  78.     {
  79.         return $this->quartiers;
  80.     }
  81.     public function addQuartier(Quartiers $quartier): self
  82.     {
  83.         if (!$this->quartiers->contains($quartier)) {
  84.             $this->quartiers[] = $quartier;
  85.             $quartier->setVille($this);
  86.         }
  87.         return $this;
  88.     }
  89.     public function removeQuartier(Quartiers $quartier): self
  90.     {
  91.         if ($this->quartiers->removeElement($quartier)) {
  92.             // set the owning side to null (unless already changed)
  93.             if ($quartier->getVille() === $this) {
  94.                 $quartier->setVille(null);
  95.             }
  96.         }
  97.         return $this;
  98.     }
  99.     /**
  100.      * @return Collection<int, Immeubles>
  101.      */
  102.     public function getImmeubles(): Collection
  103.     {
  104.         return $this->immeubles;
  105.     }
  106.     public function addImmeuble(Immeubles $immeuble): self
  107.     {
  108.         if (!$this->immeubles->contains($immeuble)) {
  109.             $this->immeubles[] = $immeuble;
  110.             $immeuble->setVille($this);
  111.         }
  112.         return $this;
  113.     }
  114.     public function removeImmeuble(Immeubles $immeuble): self
  115.     {
  116.         if ($this->immeubles->removeElement($immeuble)) {
  117.             // set the owning side to null (unless already changed)
  118.             if ($immeuble->getVille() === $this) {
  119.                 $immeuble->setVille(null);
  120.             }
  121.         }
  122.         return $this;
  123.     }
  124.     /**
  125.      * @return Collection<int, Vehicules>
  126.      */
  127.     public function getVehicules(): Collection
  128.     {
  129.         return $this->vehicules;
  130.     }
  131.     public function addVehicule(Vehicules $vehicule): self
  132.     {
  133.         if (!$this->vehicules->contains($vehicule)) {
  134.             $this->vehicules[] = $vehicule;
  135.             $vehicule->setVille($this);
  136.         }
  137.         return $this;
  138.     }
  139.     public function removeVehicule(Vehicules $vehicule): self
  140.     {
  141.         if ($this->vehicules->removeElement($vehicule)) {
  142.             // set the owning side to null (unless already changed)
  143.             if ($vehicule->getVille() === $this) {
  144.                 $vehicule->setVille(null);
  145.             }
  146.         }
  147.         return $this;
  148.     }
  149. }