<?php
namespace App\Entity;
use App\Repository\CircuitroomRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CircuitroomRepository::class)
*/
class Circuitroom
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Circuit::class, inversedBy="circuitrooms", cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*/
private $circuit;
/**
* @ORM\ManyToOne(targetEntity=Chambre::class, inversedBy="circuitrooms", cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*/
private $chambre;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $etat;
/**
* @ORM\OneToMany(targetEntity=Circuitpriceroom::class, mappedBy="circuitroom", orphanRemoval=true)
*/
private $circuitpricerooms;
public function __construct()
{
$this->circuitpricerooms = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCircuit(): ?Circuit
{
return $this->circuit;
}
public function setCircuit(?Circuit $circuit): self
{
$this->circuit = $circuit;
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, Circuitpriceroom>
*/
public function getCircuitpricerooms(): Collection
{
return $this->circuitpricerooms;
}
public function addCircuitpriceroom(Circuitpriceroom $circuitpriceroom): self
{
if (!$this->circuitpricerooms->contains($circuitpriceroom)) {
$this->circuitpricerooms[] = $circuitpriceroom;
$circuitpriceroom->setCircuitroom($this);
}
return $this;
}
public function removeCircuitpriceroom(Circuitpriceroom $circuitpriceroom): self
{
if ($this->circuitpricerooms->removeElement($circuitpriceroom)) {
// set the owning side to null (unless already changed)
if ($circuitpriceroom->getCircuitroom() === $this) {
$circuitpriceroom->setCircuitroom(null);
}
}
return $this;
}
}