<?php
namespace App\Entity;
use App\Repository\ChoixRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ChoixRepository::class)
*/
class Choix
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $nom;
/**
* @ORM\OneToMany(targetEntity=Requete::class, mappedBy="choix")
*/
private $requetes;
public function __construct()
{
$this->requetes = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
/**
* @return Collection<int, Requete>
*/
public function getRequetes(): Collection
{
return $this->requetes;
}
public function addRequete(Requete $requete): self
{
if (!$this->requetes->contains($requete)) {
$this->requetes[] = $requete;
$requete->setChoix($this);
}
return $this;
}
public function removeRequete(Requete $requete): self
{
if ($this->requetes->removeElement($requete)) {
// set the owning side to null (unless already changed)
if ($requete->getChoix() === $this) {
$requete->setChoix(null);
}
}
return $this;
}
}