<?php
namespace App\Entity;
use App\Repository\HotelroomRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=HotelroomRepository::class)
*/
class Hotelroom
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Hotel::class, inversedBy="hotelrooms", cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*/
private $hotel;
/**
* @ORM\ManyToOne(targetEntity=Chambre::class, inversedBy="hotelrooms")
* @ORM\JoinColumn(nullable=false)
*/
private $chambre;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $etat;
/**
* @ORM\OneToMany(targetEntity=Priceroom::class, mappedBy="hotelroom", orphanRemoval=true)
*/
private $pricerooms;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $adulte;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $enfant;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $age;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $personne;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $bebe;
public function __construct()
{
$this->pricerooms = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getHotel(): ?Hotel
{
return $this->hotel;
}
public function setHotel(?Hotel $hotel): self
{
$this->hotel = $hotel;
return $this;
}
public function getChambre(): ?Chambre
{
return $this->chambre;
}
public function setChambre(?Chambre $chambre): self
{
$this->chambre = $chambre;
return $this;
}
public function isEtat(): ?bool
{
return $this->etat;
}
public function setEtat(?bool $etat): self
{
$this->etat = $etat;
return $this;
}
/**
* @return Collection<int, Priceroom>
*/
public function getPricerooms(): Collection
{
return $this->pricerooms;
}
public function addPriceroom(Priceroom $priceroom): self
{
if (!$this->pricerooms->contains($priceroom)) {
$this->pricerooms[] = $priceroom;
$priceroom->setHotelroom($this);
}
return $this;
}
public function removePriceroom(Priceroom $priceroom): self
{
if ($this->pricerooms->removeElement($priceroom)) {
// set the owning side to null (unless already changed)
if ($priceroom->getHotelroom() === $this) {
$priceroom->setHotelroom(null);
}
}
return $this;
}
public function getAdulte(): ?int
{
return $this->adulte;
}
public function setAdulte(?int $adulte): self
{
$this->adulte = $adulte;
return $this;
}
public function getEnfant(): ?int
{
return $this->enfant;
}
public function setEnfant(?int $enfant): self
{
$this->enfant = $enfant;
return $this;
}
public function getAge(): ?int
{
return $this->age;
}
public function setAge(?int $age): self
{
$this->age = $age;
return $this;
}
public function isPersonne(): ?bool
{
return $this->personne;
}
public function setPersonne(?bool $personne): self
{
$this->personne = $personne;
return $this;
}
public function getBebe(): ?int
{
return $this->bebe;
}
public function setBebe(?int $bebe): self
{
$this->bebe = $bebe;
return $this;
}
}