<?php
namespace App\Entity;
use App\Repository\CabineRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CabineRepository::class)
*/
class Cabine
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $etat;
/**
* @ORM\OneToMany(targetEntity=Souscroisiereroom::class, mappedBy="chambre")
*/
private $souscroisiererooms;
public function __construct()
{
$this->souscroisiererooms = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function isEtat(): ?bool
{
return $this->etat;
}
public function setEtat(?bool $etat): self
{
$this->etat = $etat;
return $this;
}
/**
* @return Collection<int, Souscroisiereroom>
*/
public function getSouscroisiererooms(): Collection
{
return $this->souscroisiererooms;
}
public function addSouscroisiereroom(Souscroisiereroom $souscroisiereroom): self
{
if (!$this->souscroisiererooms->contains($souscroisiereroom)) {
$this->souscroisiererooms[] = $souscroisiereroom;
$souscroisiereroom->setChambre($this);
}
return $this;
}
public function removeSouscroisiereroom(Souscroisiereroom $souscroisiereroom): self
{
if ($this->souscroisiererooms->removeElement($souscroisiereroom)) {
// set the owning side to null (unless already changed)
if ($souscroisiereroom->getChambre() === $this) {
$souscroisiereroom->setChambre(null);
}
}
return $this;
}
}