src/Entity/Hotelroom.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\HotelroomRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=HotelroomRepository::class)
  9.  */
  10. class Hotelroom
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=Hotel::class, inversedBy="hotelrooms", cascade={"persist"})
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $hotel;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Chambre::class, inversedBy="hotelrooms")
  25.      * @ORM\JoinColumn(nullable=false)
  26.      */
  27.     private $chambre;
  28.     /**
  29.      * @ORM\Column(type="boolean", nullable=true)
  30.      */
  31.     private $etat;
  32.     /**
  33.      * @ORM\OneToMany(targetEntity=Priceroom::class, mappedBy="hotelroom", orphanRemoval=true)
  34.      */
  35.     private $pricerooms;
  36.     /**
  37.      * @ORM\Column(type="integer", nullable=true)
  38.      */
  39.     private $adulte;
  40.     /**
  41.      * @ORM\Column(type="integer", nullable=true)
  42.      */
  43.     private $enfant;
  44.     /**
  45.      * @ORM\Column(type="integer", nullable=true)
  46.      */
  47.     private $age;
  48.     /**
  49.      * @ORM\Column(type="boolean", nullable=true)
  50.      */
  51.     private $personne;
  52.     /**
  53.      * @ORM\Column(type="integer", nullable=true)
  54.      */
  55.     private $bebe;
  56.     public function __construct()
  57.     {
  58.         $this->pricerooms = new ArrayCollection();
  59.     }
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getHotel(): ?Hotel
  65.     {
  66.         return $this->hotel;
  67.     }
  68.     public function setHotel(?Hotel $hotel): self
  69.     {
  70.         $this->hotel $hotel;
  71.         return $this;
  72.     }
  73.     public function getChambre(): ?Chambre
  74.     {
  75.         return $this->chambre;
  76.     }
  77.     public function setChambre(?Chambre $chambre): self
  78.     {
  79.         $this->chambre $chambre;
  80.         return $this;
  81.     }
  82.     public function isEtat(): ?bool
  83.     {
  84.         return $this->etat;
  85.     }
  86.     public function setEtat(?bool $etat): self
  87.     {
  88.         $this->etat $etat;
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return Collection<int, Priceroom>
  93.      */
  94.     public function getPricerooms(): Collection
  95.     {
  96.         return $this->pricerooms;
  97.     }
  98.     public function addPriceroom(Priceroom $priceroom): self
  99.     {
  100.         if (!$this->pricerooms->contains($priceroom)) {
  101.             $this->pricerooms[] = $priceroom;
  102.             $priceroom->setHotelroom($this);
  103.         }
  104.         return $this;
  105.     }
  106.     public function removePriceroom(Priceroom $priceroom): self
  107.     {
  108.         if ($this->pricerooms->removeElement($priceroom)) {
  109.             // set the owning side to null (unless already changed)
  110.             if ($priceroom->getHotelroom() === $this) {
  111.                 $priceroom->setHotelroom(null);
  112.             }
  113.         }
  114.         return $this;
  115.     }
  116.     public function getAdulte(): ?int
  117.     {
  118.         return $this->adulte;
  119.     }
  120.     public function setAdulte(?int $adulte): self
  121.     {
  122.         $this->adulte $adulte;
  123.         return $this;
  124.     }
  125.     public function getEnfant(): ?int
  126.     {
  127.         return $this->enfant;
  128.     }
  129.     public function setEnfant(?int $enfant): self
  130.     {
  131.         $this->enfant $enfant;
  132.         return $this;
  133.     }
  134.     public function getAge(): ?int
  135.     {
  136.         return $this->age;
  137.     }
  138.     public function setAge(?int $age): self
  139.     {
  140.         $this->age $age;
  141.         return $this;
  142.     }
  143.     public function isPersonne(): ?bool
  144.     {
  145.         return $this->personne;
  146.     }
  147.     public function setPersonne(?bool $personne): self
  148.     {
  149.         $this->personne $personne;
  150.         return $this;
  151.     }
  152.     public function getBebe(): ?int
  153.     {
  154.         return $this->bebe;
  155.     }
  156.     public function setBebe(?int $bebe): self
  157.     {
  158.         $this->bebe $bebe;
  159.         return $this;
  160.     }
  161. }