src/Entity/Pays.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PaysRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=PaysRepository::class)
  9.  */
  10. class Pays
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255, nullable=true)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="boolean", nullable=true)
  24.      */
  25.     private $etat;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=Villes::class, mappedBy="pays", orphanRemoval=true)
  28.      */
  29.     private $villes;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=Hotel::class, mappedBy="pays", orphanRemoval=true)
  32.      */
  33.     private $hotels;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=Coordonnescircuit::class, mappedBy="pays", orphanRemoval=true)
  36.      */
  37.     private $coordonnescircuits;
  38.     public function __construct()
  39.     {
  40.         $this->villes = new ArrayCollection();
  41.         $this->hotels = new ArrayCollection();
  42.         $this->coordonnescircuits = new ArrayCollection();
  43.     }
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getName(): ?string
  49.     {
  50.         return $this->name;
  51.     }
  52.     public function setName(?string $name): self
  53.     {
  54.         $this->name $name;
  55.         return $this;
  56.     }
  57.     public function isEtat(): ?bool
  58.     {
  59.         return $this->etat;
  60.     }
  61.     public function setEtat(?bool $etat): self
  62.     {
  63.         $this->etat $etat;
  64.         return $this;
  65.     }
  66.     /**
  67.      * @return Collection<int, Villes>
  68.      */
  69.     public function getVilles(): Collection
  70.     {
  71.         return $this->villes;
  72.     }
  73.     public function addVille(Villes $ville): self
  74.     {
  75.         if (!$this->villes->contains($ville)) {
  76.             $this->villes[] = $ville;
  77.             $ville->setPays($this);
  78.         }
  79.         return $this;
  80.     }
  81.     public function removeVille(Villes $ville): self
  82.     {
  83.         if ($this->villes->removeElement($ville)) {
  84.             // set the owning side to null (unless already changed)
  85.             if ($ville->getPays() === $this) {
  86.                 $ville->setPays(null);
  87.             }
  88.         }
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return Collection<int, Hotel>
  93.      */
  94.     public function getHotels(): Collection
  95.     {
  96.         return $this->hotels;
  97.     }
  98.     public function addHotel(Hotel $hotel): self
  99.     {
  100.         if (!$this->hotels->contains($hotel)) {
  101.             $this->hotels[] = $hotel;
  102.             $hotel->setPays($this);
  103.         }
  104.         return $this;
  105.     }
  106.     public function removeHotel(Hotel $hotel): self
  107.     {
  108.         if ($this->hotels->removeElement($hotel)) {
  109.             // set the owning side to null (unless already changed)
  110.             if ($hotel->getPays() === $this) {
  111.                 $hotel->setPays(null);
  112.             }
  113.         }
  114.         return $this;
  115.     }
  116.     public function __toString()
  117.     {
  118.         return $this->name;
  119.     }
  120.     /**
  121.      * @return Collection<int, Coordonnescircuit>
  122.      */
  123.     public function getCoordonnescircuits(): Collection
  124.     {
  125.         return $this->coordonnescircuits;
  126.     }
  127.     public function addCoordonnescircuit(Coordonnescircuit $coordonnescircuit): self
  128.     {
  129.         if (!$this->coordonnescircuits->contains($coordonnescircuit)) {
  130.             $this->coordonnescircuits[] = $coordonnescircuit;
  131.             $coordonnescircuit->setPays($this);
  132.         }
  133.         return $this;
  134.     }
  135.     public function removeCoordonnescircuit(Coordonnescircuit $coordonnescircuit): self
  136.     {
  137.         if ($this->coordonnescircuits->removeElement($coordonnescircuit)) {
  138.             // set the owning side to null (unless already changed)
  139.             if ($coordonnescircuit->getPays() === $this) {
  140.                 $coordonnescircuit->setPays(null);
  141.             }
  142.         }
  143.         return $this;
  144.     }
  145. }