<?php
namespace App\Entity;
use App\Repository\HotelRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=HotelRepository::class)
*/
class Hotel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $maps;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $star;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $maxenfant;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $minenfant;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $shortdesc;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $visite;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $longdesc;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $etat;
/**
* @ORM\ManyToOne(targetEntity=Pays::class, inversedBy="hotels")
* @ORM\JoinColumn(nullable=false)
*/
private $pays;
/**
* @ORM\ManyToOne(targetEntity=Villes::class, inversedBy="hotels")
* @ORM\JoinColumn(nullable=false)
*/
private $ville;
/**
* @ORM\OneToMany(targetEntity=Hotelroom::class, mappedBy="hotel", orphanRemoval=true)
*/
private $hotelrooms;
/**
* @ORM\OneToMany(targetEntity=Hotelprice::class, mappedBy="hotel", orphanRemoval=true)
*/
private $hotelprices;
/**
* @ORM\OneToMany(targetEntity=Hotelarrangement::class, mappedBy="hotel", orphanRemoval=true)
*/
private $hotelarrangements;
/**
* @ORM\OneToMany(targetEntity=Imageshotels::class, mappedBy="hotel", orphanRemoval=true, cascade={"persist"})
*/
private $imageshotels;
/**
* @ORM\OneToMany(targetEntity=Hotelsupplement::class, mappedBy="hotel", orphanRemoval=true)
*/
private $hotelsupplements;
/**
* @ORM\OneToMany(targetEntity=Reservationhotel::class, mappedBy="hotel", orphanRemoval=true)
*/
private $reservationhotels;
/**
* @ORM\ManyToMany(targetEntity=Service::class, mappedBy="hotel")
*/
private $services;
public function __construct()
{
$this->hotelrooms = new ArrayCollection();
$this->hotelprices = new ArrayCollection();
$this->hotelarrangements = new ArrayCollection();
$this->imageshotels = new ArrayCollection();
$this->hotelsupplements = new ArrayCollection();
$this->reservationhotels = new ArrayCollection();
$this->services = 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 getMaps(): ?string
{
return $this->maps;
}
public function setMaps(?string $maps): self
{
$this->maps = $maps;
return $this;
}
public function getStar(): ?int
{
return $this->star;
}
public function setStar(?int $star): self
{
$this->star = $star;
return $this;
}
public function getMaxenfant(): ?int
{
return $this->maxenfant;
}
public function setMaxenfant(?int $maxenfant): self
{
$this->maxenfant = $maxenfant;
return $this;
}
public function getMinenfant(): ?int
{
return $this->minenfant;
}
public function setMinenfant(?int $minenfant): self
{
$this->minenfant = $minenfant;
return $this;
}
public function getShortdesc(): ?string
{
return $this->shortdesc;
}
public function setShortdesc(?string $shortdesc): self
{
$this->shortdesc = $shortdesc;
return $this;
}
public function getVisite(): ?string
{
return $this->visite;
}
public function setVisite(?string $visite): self
{
$this->visite = $visite;
return $this;
}
public function getLongdesc(): ?string
{
return $this->longdesc;
}
public function setLongdesc(?string $longdesc): self
{
$this->longdesc = $longdesc;
return $this;
}
public function isEtat(): ?bool
{
return $this->etat;
}
public function setEtat(?bool $etat): self
{
$this->etat = $etat;
return $this;
}
public function getPays(): ?Pays
{
return $this->pays;
}
public function setPays(?Pays $pays): self
{
$this->pays = $pays;
return $this;
}
public function getVille(): ?Villes
{
return $this->ville;
}
public function setVille(?Villes $ville): self
{
$this->ville = $ville;
return $this;
}
/**
* @return Collection<int, Hotelroom>
*/
public function getHotelrooms(): Collection
{
return $this->hotelrooms;
}
public function addHotelroom(Hotelroom $hotelroom): self
{
if (!$this->hotelrooms->contains($hotelroom)) {
$this->hotelrooms[] = $hotelroom;
$hotelroom->setHotel($this);
}
return $this;
}
public function removeHotelroom(Hotelroom $hotelroom): self
{
if ($this->hotelrooms->removeElement($hotelroom)) {
// set the owning side to null (unless already changed)
if ($hotelroom->getHotel() === $this) {
$hotelroom->setHotel(null);
}
}
return $this;
}
/**
* @return Collection<int, Hotelprice>
*/
public function getHotelprices(): Collection
{
return $this->hotelprices;
}
public function addHotelprice(Hotelprice $hotelprice): self
{
if (!$this->hotelprices->contains($hotelprice)) {
$this->hotelprices[] = $hotelprice;
$hotelprice->setHotel($this);
}
return $this;
}
public function removeHotelprice(Hotelprice $hotelprice): self
{
if ($this->hotelprices->removeElement($hotelprice)) {
// set the owning side to null (unless already changed)
if ($hotelprice->getHotel() === $this) {
$hotelprice->setHotel(null);
}
}
return $this;
}
public function __toString()
{
return (string) $this->name;
}
/**
* @return Collection<int, Hotelarrangement>
*/
public function getHotelarrangements(): Collection
{
return $this->hotelarrangements;
}
public function addHotelarrangement(Hotelarrangement $hotelarrangement): self
{
if (!$this->hotelarrangements->contains($hotelarrangement)) {
$this->hotelarrangements[] = $hotelarrangement;
$hotelarrangement->setHotel($this);
}
return $this;
}
public function removeHotelarrangement(Hotelarrangement $hotelarrangement): self
{
if ($this->hotelarrangements->removeElement($hotelarrangement)) {
// set the owning side to null (unless already changed)
if ($hotelarrangement->getHotel() === $this) {
$hotelarrangement->setHotel(null);
}
}
return $this;
}
/**
* @return Collection<int, Imageshotels>
*/
public function getImageshotels(): Collection
{
return $this->imageshotels;
}
public function addImageshotel(Imageshotels $imageshotel): self
{
if (!$this->imageshotels->contains($imageshotel)) {
$this->imageshotels[] = $imageshotel;
$imageshotel->setHotel($this);
}
return $this;
}
public function removeImageshotel(Imageshotels $imageshotel): self
{
if ($this->imageshotels->removeElement($imageshotel)) {
// set the owning side to null (unless already changed)
if ($imageshotel->getHotel() === $this) {
$imageshotel->setHotel(null);
}
}
return $this;
}
/**
* @return Collection<int, Hotelsupplement>
*/
public function getHotelsupplements(): Collection
{
return $this->hotelsupplements;
}
public function addHotelsupplement(Hotelsupplement $hotelsupplement): self
{
if (!$this->hotelsupplements->contains($hotelsupplement)) {
$this->hotelsupplements[] = $hotelsupplement;
$hotelsupplement->setHotel($this);
}
return $this;
}
public function removeHotelsupplement(Hotelsupplement $hotelsupplement): self
{
if ($this->hotelsupplements->removeElement($hotelsupplement)) {
// set the owning side to null (unless already changed)
if ($hotelsupplement->getHotel() === $this) {
$hotelsupplement->setHotel(null);
}
}
return $this;
}
/**
* @return Collection<int, Reservationhotel>
*/
public function getReservationhotels(): Collection
{
return $this->reservationhotels;
}
public function addReservationhotel(Reservationhotel $reservationhotel): self
{
if (!$this->reservationhotels->contains($reservationhotel)) {
$this->reservationhotels[] = $reservationhotel;
$reservationhotel->setHotel($this);
}
return $this;
}
public function removeReservationhotel(Reservationhotel $reservationhotel): self
{
if ($this->reservationhotels->removeElement($reservationhotel)) {
// set the owning side to null (unless already changed)
if ($reservationhotel->getHotel() === $this) {
$reservationhotel->setHotel(null);
}
}
return $this;
}
/**
* @return Collection<int, Service>
*/
public function getServices(): Collection
{
return $this->services;
}
public function addService(Service $service): self
{
if (!$this->services->contains($service)) {
$this->services[] = $service;
$service->addHotel($this);
}
return $this;
}
public function removeService(Service $service): self
{
if ($this->services->removeElement($service)) {
$service->removeHotel($this);
}
return $this;
}
}