src/Entity/Hotel.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\HotelRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=HotelRepository::class)
  9.  */
  10. class Hotel
  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="string", length=255, nullable=true)
  24.      */
  25.     private $maps;
  26.     /**
  27.      * @ORM\Column(type="integer", nullable=true)
  28.      */
  29.     private $star;
  30.     /**
  31.      * @ORM\Column(type="integer", nullable=true)
  32.      */
  33.     private $maxenfant;
  34.     /**
  35.      * @ORM\Column(type="integer", nullable=true)
  36.      */
  37.     private $minenfant;
  38.     /**
  39.      * @ORM\Column(type="text", nullable=true)
  40.      */
  41.     private $shortdesc;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      */
  45.     private $visite;
  46.     /**
  47.      * @ORM\Column(type="text", nullable=true)
  48.      */
  49.     private $longdesc;
  50.     /**
  51.      * @ORM\Column(type="boolean", nullable=true)
  52.      */
  53.     private $etat;
  54.     /**
  55.      * @ORM\ManyToOne(targetEntity=Pays::class, inversedBy="hotels")
  56.      * @ORM\JoinColumn(nullable=false)
  57.      */
  58.     private $pays;
  59.     /**
  60.      * @ORM\ManyToOne(targetEntity=Villes::class, inversedBy="hotels")
  61.      * @ORM\JoinColumn(nullable=false)
  62.      */
  63.     private $ville;
  64.     /**
  65.      * @ORM\OneToMany(targetEntity=Hotelroom::class, mappedBy="hotel", orphanRemoval=true)
  66.      */
  67.     private $hotelrooms;
  68.     /**
  69.      * @ORM\OneToMany(targetEntity=Hotelprice::class, mappedBy="hotel", orphanRemoval=true)
  70.      */
  71.     private $hotelprices;
  72.     /**
  73.      * @ORM\OneToMany(targetEntity=Hotelarrangement::class, mappedBy="hotel", orphanRemoval=true)
  74.      */
  75.     private $hotelarrangements;
  76.     /**
  77.      * @ORM\OneToMany(targetEntity=Imageshotels::class, mappedBy="hotel", orphanRemoval=true, cascade={"persist"})
  78.      */
  79.     private $imageshotels;
  80.     /**
  81.      * @ORM\OneToMany(targetEntity=Hotelsupplement::class, mappedBy="hotel", orphanRemoval=true)
  82.      */
  83.     private $hotelsupplements;
  84.     /**
  85.      * @ORM\OneToMany(targetEntity=Reservationhotel::class, mappedBy="hotel", orphanRemoval=true)
  86.      */
  87.     private $reservationhotels;
  88.     /**
  89.      * @ORM\ManyToMany(targetEntity=Service::class, mappedBy="hotel")
  90.      */
  91.     private $services;
  92.     public function __construct()
  93.     {
  94.         $this->hotelrooms = new ArrayCollection();
  95.         $this->hotelprices = new ArrayCollection();
  96.         $this->hotelarrangements = new ArrayCollection();
  97.         $this->imageshotels = new ArrayCollection();
  98.         $this->hotelsupplements = new ArrayCollection();
  99.         $this->reservationhotels = new ArrayCollection();
  100.         $this->services = new ArrayCollection();
  101.     }
  102.     public function getId(): ?int
  103.     {
  104.         return $this->id;
  105.     }
  106.     public function getName(): ?string
  107.     {
  108.         return $this->name;
  109.     }
  110.     public function setName(?string $name): self
  111.     {
  112.         $this->name $name;
  113.         return $this;
  114.     }
  115.     public function getMaps(): ?string
  116.     {
  117.         return $this->maps;
  118.     }
  119.     public function setMaps(?string $maps): self
  120.     {
  121.         $this->maps $maps;
  122.         return $this;
  123.     }
  124.     public function getStar(): ?int
  125.     {
  126.         return $this->star;
  127.     }
  128.     public function setStar(?int $star): self
  129.     {
  130.         $this->star $star;
  131.         return $this;
  132.     }
  133.     public function getMaxenfant(): ?int
  134.     {
  135.         return $this->maxenfant;
  136.     }
  137.     public function setMaxenfant(?int $maxenfant): self
  138.     {
  139.         $this->maxenfant $maxenfant;
  140.         return $this;
  141.     }
  142.     public function getMinenfant(): ?int
  143.     {
  144.         return $this->minenfant;
  145.     }
  146.     public function setMinenfant(?int $minenfant): self
  147.     {
  148.         $this->minenfant $minenfant;
  149.         return $this;
  150.     }
  151.     public function getShortdesc(): ?string
  152.     {
  153.         return $this->shortdesc;
  154.     }
  155.     public function setShortdesc(?string $shortdesc): self
  156.     {
  157.         $this->shortdesc $shortdesc;
  158.         return $this;
  159.     }
  160.     public function getVisite(): ?string
  161.     {
  162.         return $this->visite;
  163.     }
  164.     public function setVisite(?string $visite): self
  165.     {
  166.         $this->visite $visite;
  167.         return $this;
  168.     }
  169.     public function getLongdesc(): ?string
  170.     {
  171.         return $this->longdesc;
  172.     }
  173.     public function setLongdesc(?string $longdesc): self
  174.     {
  175.         $this->longdesc $longdesc;
  176.         return $this;
  177.     }
  178.     public function isEtat(): ?bool
  179.     {
  180.         return $this->etat;
  181.     }
  182.     public function setEtat(?bool $etat): self
  183.     {
  184.         $this->etat $etat;
  185.         return $this;
  186.     }
  187.     public function getPays(): ?Pays
  188.     {
  189.         return $this->pays;
  190.     }
  191.     public function setPays(?Pays $pays): self
  192.     {
  193.         $this->pays $pays;
  194.         return $this;
  195.     }
  196.     public function getVille(): ?Villes
  197.     {
  198.         return $this->ville;
  199.     }
  200.     public function setVille(?Villes $ville): self
  201.     {
  202.         $this->ville $ville;
  203.         return $this;
  204.     }
  205.     /**
  206.      * @return Collection<int, Hotelroom>
  207.      */
  208.     public function getHotelrooms(): Collection
  209.     {
  210.         return $this->hotelrooms;
  211.     }
  212.     public function addHotelroom(Hotelroom $hotelroom): self
  213.     {
  214.         if (!$this->hotelrooms->contains($hotelroom)) {
  215.             $this->hotelrooms[] = $hotelroom;
  216.             $hotelroom->setHotel($this);
  217.         }
  218.         return $this;
  219.     }
  220.     public function removeHotelroom(Hotelroom $hotelroom): self
  221.     {
  222.         if ($this->hotelrooms->removeElement($hotelroom)) {
  223.             // set the owning side to null (unless already changed)
  224.             if ($hotelroom->getHotel() === $this) {
  225.                 $hotelroom->setHotel(null);
  226.             }
  227.         }
  228.         return $this;
  229.     }
  230.     /**
  231.      * @return Collection<int, Hotelprice>
  232.      */
  233.     public function getHotelprices(): Collection
  234.     {
  235.         return $this->hotelprices;
  236.     }
  237.     public function addHotelprice(Hotelprice $hotelprice): self
  238.     {
  239.         if (!$this->hotelprices->contains($hotelprice)) {
  240.             $this->hotelprices[] = $hotelprice;
  241.             $hotelprice->setHotel($this);
  242.         }
  243.         return $this;
  244.     }
  245.     public function removeHotelprice(Hotelprice $hotelprice): self
  246.     {
  247.         if ($this->hotelprices->removeElement($hotelprice)) {
  248.             // set the owning side to null (unless already changed)
  249.             if ($hotelprice->getHotel() === $this) {
  250.                 $hotelprice->setHotel(null);
  251.             }
  252.         }
  253.         return $this;
  254.     }
  255.     public function __toString()
  256.     {
  257.         return (string) $this->name;
  258.     }
  259.     /**
  260.      * @return Collection<int, Hotelarrangement>
  261.      */
  262.     public function getHotelarrangements(): Collection
  263.     {
  264.         return $this->hotelarrangements;
  265.     }
  266.     public function addHotelarrangement(Hotelarrangement $hotelarrangement): self
  267.     {
  268.         if (!$this->hotelarrangements->contains($hotelarrangement)) {
  269.             $this->hotelarrangements[] = $hotelarrangement;
  270.             $hotelarrangement->setHotel($this);
  271.         }
  272.         return $this;
  273.     }
  274.     public function removeHotelarrangement(Hotelarrangement $hotelarrangement): self
  275.     {
  276.         if ($this->hotelarrangements->removeElement($hotelarrangement)) {
  277.             // set the owning side to null (unless already changed)
  278.             if ($hotelarrangement->getHotel() === $this) {
  279.                 $hotelarrangement->setHotel(null);
  280.             }
  281.         }
  282.         return $this;
  283.     }
  284.     /**
  285.      * @return Collection<int, Imageshotels>
  286.      */
  287.     public function getImageshotels(): Collection
  288.     {
  289.         return $this->imageshotels;
  290.     }
  291.     public function addImageshotel(Imageshotels $imageshotel): self
  292.     {
  293.         if (!$this->imageshotels->contains($imageshotel)) {
  294.             $this->imageshotels[] = $imageshotel;
  295.             $imageshotel->setHotel($this);
  296.         }
  297.         return $this;
  298.     }
  299.     public function removeImageshotel(Imageshotels $imageshotel): self
  300.     {
  301.         if ($this->imageshotels->removeElement($imageshotel)) {
  302.             // set the owning side to null (unless already changed)
  303.             if ($imageshotel->getHotel() === $this) {
  304.                 $imageshotel->setHotel(null);
  305.             }
  306.         }
  307.         return $this;
  308.     }
  309.     /**
  310.      * @return Collection<int, Hotelsupplement>
  311.      */
  312.     public function getHotelsupplements(): Collection
  313.     {
  314.         return $this->hotelsupplements;
  315.     }
  316.     public function addHotelsupplement(Hotelsupplement $hotelsupplement): self
  317.     {
  318.         if (!$this->hotelsupplements->contains($hotelsupplement)) {
  319.             $this->hotelsupplements[] = $hotelsupplement;
  320.             $hotelsupplement->setHotel($this);
  321.         }
  322.         return $this;
  323.     }
  324.     public function removeHotelsupplement(Hotelsupplement $hotelsupplement): self
  325.     {
  326.         if ($this->hotelsupplements->removeElement($hotelsupplement)) {
  327.             // set the owning side to null (unless already changed)
  328.             if ($hotelsupplement->getHotel() === $this) {
  329.                 $hotelsupplement->setHotel(null);
  330.             }
  331.         }
  332.         return $this;
  333.     }
  334.     /**
  335.      * @return Collection<int, Reservationhotel>
  336.      */
  337.     public function getReservationhotels(): Collection
  338.     {
  339.         return $this->reservationhotels;
  340.     }
  341.     public function addReservationhotel(Reservationhotel $reservationhotel): self
  342.     {
  343.         if (!$this->reservationhotels->contains($reservationhotel)) {
  344.             $this->reservationhotels[] = $reservationhotel;
  345.             $reservationhotel->setHotel($this);
  346.         }
  347.         return $this;
  348.     }
  349.     public function removeReservationhotel(Reservationhotel $reservationhotel): self
  350.     {
  351.         if ($this->reservationhotels->removeElement($reservationhotel)) {
  352.             // set the owning side to null (unless already changed)
  353.             if ($reservationhotel->getHotel() === $this) {
  354.                 $reservationhotel->setHotel(null);
  355.             }
  356.         }
  357.         return $this;
  358.     }
  359.     /**
  360.      * @return Collection<int, Service>
  361.      */
  362.     public function getServices(): Collection
  363.     {
  364.         return $this->services;
  365.     }
  366.     public function addService(Service $service): self
  367.     {
  368.         if (!$this->services->contains($service)) {
  369.             $this->services[] = $service;
  370.             $service->addHotel($this);
  371.         }
  372.         return $this;
  373.     }
  374.     public function removeService(Service $service): self
  375.     {
  376.         if ($this->services->removeElement($service)) {
  377.             $service->removeHotel($this);
  378.         }
  379.         return $this;
  380.     }
  381. }