src/Entity/Ville.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\VilleRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassVilleRepository::class)]
  8. class Ville
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private $nom;
  16.     #[ORM\OneToMany(mappedBy'ville'targetEntityOffreEmploi::class)]
  17.     private $offreEmplois;
  18.     #[ORM\OneToMany(mappedBy'ville'targetEntityRepriseActivite::class)]
  19.     private $repriseActivites;
  20.     #[ORM\OneToMany(mappedBy'ville'targetEntityOffreImmobiliere::class)]
  21.     private $offreImmobilieres;
  22.     public function __construct()
  23.     {
  24.         $this->offreEmplois = new ArrayCollection();
  25.         $this->repriseActivites = new ArrayCollection();
  26.         $this->offreImmobilieres = new ArrayCollection();
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getNom(): ?string
  33.     {
  34.         return $this->nom;
  35.     }
  36.     public function setNom(?string $nom): self
  37.     {
  38.         $this->nom $nom;
  39.         return $this;
  40.     }
  41.     /**
  42.      * @return Collection<int, OffreEmploi>
  43.      */
  44.     public function getOffreEmplois(): Collection
  45.     {
  46.         return $this->offreEmplois;
  47.     }
  48.     public function addOffreEmploi(OffreEmploi $offreEmploi): self
  49.     {
  50.         if (!$this->offreEmplois->contains($offreEmploi)) {
  51.             $this->offreEmplois[] = $offreEmploi;
  52.             $offreEmploi->setVille($this);
  53.         }
  54.         return $this;
  55.     }
  56.     public function removeOffreEmploi(OffreEmploi $offreEmploi): self
  57.     {
  58.         if ($this->offreEmplois->removeElement($offreEmploi)) {
  59.             // set the owning side to null (unless already changed)
  60.             if ($offreEmploi->getVille() === $this) {
  61.                 $offreEmploi->setVille(null);
  62.             }
  63.         }
  64.         return $this;
  65.     }
  66.     /**
  67.      * @return Collection<int, RepriseActivite>
  68.      */
  69.     public function getRepriseActivites(): Collection
  70.     {
  71.         return $this->repriseActivites;
  72.     }
  73.     public function addRepriseActivite(RepriseActivite $repriseActivite): self
  74.     {
  75.         if (!$this->repriseActivites->contains($repriseActivite)) {
  76.             $this->repriseActivites[] = $repriseActivite;
  77.             $repriseActivite->setVille($this);
  78.         }
  79.         return $this;
  80.     }
  81.     public function removeRepriseActivite(RepriseActivite $repriseActivite): self
  82.     {
  83.         if ($this->repriseActivites->removeElement($repriseActivite)) {
  84.             // set the owning side to null (unless already changed)
  85.             if ($repriseActivite->getVille() === $this) {
  86.                 $repriseActivite->setVille(null);
  87.             }
  88.         }
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return Collection<int, OffreImmobiliere>
  93.      */
  94.     public function getOffreImmobilieres(): Collection
  95.     {
  96.         return $this->offreImmobilieres;
  97.     }
  98.     public function addOffreImmobiliere(OffreImmobiliere $offreImmobiliere): self
  99.     {
  100.         if (!$this->offreImmobilieres->contains($offreImmobiliere)) {
  101.             $this->offreImmobilieres[] = $offreImmobiliere;
  102.             $offreImmobiliere->setVille($this);
  103.         }
  104.         return $this;
  105.     }
  106.     public function removeOffreImmobiliere(OffreImmobiliere $offreImmobiliere): self
  107.     {
  108.         if ($this->offreImmobilieres->removeElement($offreImmobiliere)) {
  109.             // set the owning side to null (unless already changed)
  110.             if ($offreImmobiliere->getVille() === $this) {
  111.                 $offreImmobiliere->setVille(null);
  112.             }
  113.         }
  114.         return $this;
  115.     }
  116. }