<?php
namespace App\Entity;
use App\Repository\TypeParticipantRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TypeParticipantRepository::class)
*/
class TypeParticipant
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=30)
*/
private $typeParticipant;
/**
* @ORM\Column(type="string", length=30)
*/
private $slugTypeParticipant;
/**
* @ORM\ManyToMany(targetEntity=Chambre::class, mappedBy="typeParticipant")
*/
private $chambres;
public function __construct()
{
$this->chambres = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTypeParticipant(): ?string
{
return $this->typeParticipant;
}
public function setTypeParticipant(string $typeParticipant): self
{
$this->typeParticipant = $typeParticipant;
return $this;
}
public function getSlugTypeParticipant(): ?string
{
return $this->slugTypeParticipant;
}
public function setSlugTypeParticipant(string $slugTypeParticipant): self
{
$this->slugTypeParticipant = $slugTypeParticipant;
return $this;
}
/**
* @return Collection|Chambre[]
*/
public function getChambres(): Collection
{
return $this->chambres;
}
public function addChambre(Chambre $chambre): self
{
if (!$this->chambres->contains($chambre)) {
$this->chambres[] = $chambre;
$chambre->addTypeParticipant($this);
}
return $this;
}
public function removeChambre(Chambre $chambre): self
{
if ($this->chambres->removeElement($chambre)) {
$chambre->removeTypeParticipant($this);
}
return $this;
}
}