<?php
namespace App\Entity;
use App\Repository\ChambreRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ChambreRepository::class)
*/
class Chambre
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Product::class, inversedBy="chambres", cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*/
private $product;
/**
* @ORM\Column(type="string", length=255)
*/
private $typeChambre;
/**
* @ORM\Column(type="integer")
*/
private $NumChambre;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $nombreLits;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $tarifNuit;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $tarifJour;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $imageChambre;
/**
* @ORM\ManyToMany(targetEntity=LitsChambre::class, inversedBy="chambres")
*/
private $typeDeLits;
/**
* @ORM\ManyToMany(targetEntity=TypeParticipant::class, inversedBy="chambres")
*/
private $typeParticipant;
/**
* @ORM\Column(type="array", nullable=true)
*/
private $litChambreData = [];
/**
* @ORM\OneToMany(targetEntity=TableUser::class, mappedBy="chambre", cascade={"remove"})
*/
private $participant;
public function __construct()
{
$this->typeDeLits = new ArrayCollection();
$this->typeParticipant = new ArrayCollection();
$this->participant = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTypeChambre(): ?string
{
return $this->typeChambre;
}
public function setTypeChambre(string $typeChambre): self
{
$this->typeChambre = $typeChambre;
return $this;
}
public function getNumChambre(): ?int
{
return $this->NumChambre;
}
public function setNumChambre(int $NumChambre): self
{
$this->NumChambre = $NumChambre;
return $this;
}
public function getNombreLits(): ?int
{
return $this->nombreLits;
}
public function setNombreLits(int $nombreLits): self
{
$this->nombreLits = $nombreLits;
return $this;
}
public function getTarifNuit(): ?float
{
return $this->tarifNuit;
}
public function setTarifNuit(?float $tarifNuit = null): self
{
$this->tarifNuit = $tarifNuit;
return $this;
}
public function getTarifJour(): ?float
{
return $this->tarifJour;
}
public function setTarifJour(?float $tarifJour = null): self
{
$this->tarifJour = $tarifJour;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
public function getImageChambre(): ?string
{
return $this->imageChambre;
}
public function setImageChambre(?string $imageChambre): self
{
$this->imageChambre = $imageChambre;
return $this;
}
/**
* @return Collection|LitsChambre[]
*/
public function getTypeDeLits(): Collection
{
return $this->typeDeLits;
}
public function addTypeDeLit(LitsChambre $typeDeLit): self
{
if (!$this->typeDeLits->contains($typeDeLit)) {
$this->typeDeLits[] = $typeDeLit;
}
return $this;
}
public function removeTypeDeLit(LitsChambre $typeDeLit): self
{
$this->typeDeLits->removeElement($typeDeLit);
return $this;
}
/**
* @return Collection|TypeParticipant[]
*/
public function getTypeParticipant(): Collection
{
return $this->typeParticipant;
}
public function addTypeParticipant(TypeParticipant $typeParticipant): self
{
if (!$this->typeParticipant->contains($typeParticipant)) {
$this->typeParticipant[] = $typeParticipant;
}
return $this;
}
public function removeTypeParticipant(TypeParticipant $typeParticipant): self
{
$this->typeParticipant->removeElement($typeParticipant);
return $this;
}
public function getLitChambreData(): ?array
{
return $this->litChambreData;
}
public function setLitChambreData(?array $litChambreData): self
{
$this->litChambreData = $litChambreData;
return $this;
}
/**
* @return Collection|TableUser[]
*/
public function getParticipant(): Collection
{
return $this->participant;
}
public function addParticipant(TableUser $participant): self
{
if (!$this->participant->contains($participant)) {
$this->participant[] = $participant;
$participant->setChambre($this);
}
return $this;
}
public function removeParticipant(TableUser $participant): self
{
if ($this->participant->removeElement($participant)) {
// set the owning side to null (unless already changed)
if ($participant->getChambre() === $this) {
$participant->setChambre(null);
}
}
return $this;
}
}