<?php
namespace App\Entity;
use App\Repository\HotelsupplementRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=HotelsupplementRepository::class)
*/
class Hotelsupplement
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Hotel::class, inversedBy="hotelsupplements")
* @ORM\JoinColumn(nullable=false)
*/
private $hotel;
/**
* @ORM\ManyToOne(targetEntity=Supplements::class, inversedBy="hotelsupplements")
* @ORM\JoinColumn(nullable=false)
*/
private $supplement;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $etat;
/**
* @ORM\OneToMany(targetEntity=Pricesupplement::class, mappedBy="hotelsupplement", orphanRemoval=true)
*/
private $pricesupplements;
public function __construct()
{
$this->pricesupplements = 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 getSupplement(): ?Supplements
{
return $this->supplement;
}
public function setSupplement(?Supplements $supplement): self
{
$this->supplement = $supplement;
return $this;
}
public function isEtat(): ?bool
{
return $this->etat;
}
public function setEtat(?bool $etat): self
{
$this->etat = $etat;
return $this;
}
/**
* @return Collection<int, Pricesupplement>
*/
public function getPricesupplements(): Collection
{
return $this->pricesupplements;
}
public function addPricesupplement(Pricesupplement $pricesupplement): self
{
if (!$this->pricesupplements->contains($pricesupplement)) {
$this->pricesupplements[] = $pricesupplement;
$pricesupplement->setHotelsupplement($this);
}
return $this;
}
public function removePricesupplement(Pricesupplement $pricesupplement): self
{
if ($this->pricesupplements->removeElement($pricesupplement)) {
// set the owning side to null (unless already changed)
if ($pricesupplement->getHotelsupplement() === $this) {
$pricesupplement->setHotelsupplement(null);
}
}
return $this;
}
}