src/Entity/Hotelsupplement.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\HotelsupplementRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=HotelsupplementRepository::class)
  9.  */
  10. class Hotelsupplement
  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="hotelsupplements")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $hotel;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Supplements::class, inversedBy="hotelsupplements")
  25.      * @ORM\JoinColumn(nullable=false)
  26.      */
  27.     private $supplement;
  28.     /**
  29.      * @ORM\Column(type="boolean", nullable=true)
  30.      */
  31.     private $etat;
  32.     /**
  33.      * @ORM\OneToMany(targetEntity=Pricesupplement::class, mappedBy="hotelsupplement", orphanRemoval=true)
  34.      */
  35.     private $pricesupplements;
  36.     public function __construct()
  37.     {
  38.         $this->pricesupplements = new ArrayCollection();
  39.     }
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getHotel(): ?Hotel
  45.     {
  46.         return $this->hotel;
  47.     }
  48.     public function setHotel(?Hotel $hotel): self
  49.     {
  50.         $this->hotel $hotel;
  51.         return $this;
  52.     }
  53.     public function getSupplement(): ?Supplements
  54.     {
  55.         return $this->supplement;
  56.     }
  57.     public function setSupplement(?Supplements $supplement): self
  58.     {
  59.         $this->supplement $supplement;
  60.         return $this;
  61.     }
  62.     public function isEtat(): ?bool
  63.     {
  64.         return $this->etat;
  65.     }
  66.     public function setEtat(?bool $etat): self
  67.     {
  68.         $this->etat $etat;
  69.         return $this;
  70.     }
  71.     /**
  72.      * @return Collection<int, Pricesupplement>
  73.      */
  74.     public function getPricesupplements(): Collection
  75.     {
  76.         return $this->pricesupplements;
  77.     }
  78.     public function addPricesupplement(Pricesupplement $pricesupplement): self
  79.     {
  80.         if (!$this->pricesupplements->contains($pricesupplement)) {
  81.             $this->pricesupplements[] = $pricesupplement;
  82.             $pricesupplement->setHotelsupplement($this);
  83.         }
  84.         return $this;
  85.     }
  86.     public function removePricesupplement(Pricesupplement $pricesupplement): self
  87.     {
  88.         if ($this->pricesupplements->removeElement($pricesupplement)) {
  89.             // set the owning side to null (unless already changed)
  90.             if ($pricesupplement->getHotelsupplement() === $this) {
  91.                 $pricesupplement->setHotelsupplement(null);
  92.             }
  93.         }
  94.         return $this;
  95.     }
  96. }