<?php
namespace App\Entity;
use App\Repository\PaysRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PaysRepository::class)
*/
class Pays
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $etat;
/**
* @ORM\OneToMany(targetEntity=Villes::class, mappedBy="pays", orphanRemoval=true)
*/
private $villes;
/**
* @ORM\OneToMany(targetEntity=Hotel::class, mappedBy="pays", orphanRemoval=true)
*/
private $hotels;
/**
* @ORM\OneToMany(targetEntity=Coordonnescircuit::class, mappedBy="pays", orphanRemoval=true)
*/
private $coordonnescircuits;
public function __construct()
{
$this->villes = new ArrayCollection();
$this->hotels = new ArrayCollection();
$this->coordonnescircuits = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function isEtat(): ?bool
{
return $this->etat;
}
public function setEtat(?bool $etat): self
{
$this->etat = $etat;
return $this;
}
/**
* @return Collection<int, Villes>
*/
public function getVilles(): Collection
{
return $this->villes;
}
public function addVille(Villes $ville): self
{
if (!$this->villes->contains($ville)) {
$this->villes[] = $ville;
$ville->setPays($this);
}
return $this;
}
public function removeVille(Villes $ville): self
{
if ($this->villes->removeElement($ville)) {
// set the owning side to null (unless already changed)
if ($ville->getPays() === $this) {
$ville->setPays(null);
}
}
return $this;
}
/**
* @return Collection<int, Hotel>
*/
public function getHotels(): Collection
{
return $this->hotels;
}
public function addHotel(Hotel $hotel): self
{
if (!$this->hotels->contains($hotel)) {
$this->hotels[] = $hotel;
$hotel->setPays($this);
}
return $this;
}
public function removeHotel(Hotel $hotel): self
{
if ($this->hotels->removeElement($hotel)) {
// set the owning side to null (unless already changed)
if ($hotel->getPays() === $this) {
$hotel->setPays(null);
}
}
return $this;
}
public function __toString()
{
return $this->name;
}
/**
* @return Collection<int, Coordonnescircuit>
*/
public function getCoordonnescircuits(): Collection
{
return $this->coordonnescircuits;
}
public function addCoordonnescircuit(Coordonnescircuit $coordonnescircuit): self
{
if (!$this->coordonnescircuits->contains($coordonnescircuit)) {
$this->coordonnescircuits[] = $coordonnescircuit;
$coordonnescircuit->setPays($this);
}
return $this;
}
public function removeCoordonnescircuit(Coordonnescircuit $coordonnescircuit): self
{
if ($this->coordonnescircuits->removeElement($coordonnescircuit)) {
// set the owning side to null (unless already changed)
if ($coordonnescircuit->getPays() === $this) {
$coordonnescircuit->setPays(null);
}
}
return $this;
}
}