<?php
namespace App\Entity;
use App\Repository\CategorieQuestionRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CategorieQuestionRepository::class)
*/
class CategorieQuestion
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $wording;
/**
* @ORM\OneToMany(targetEntity=QuestionTestB1::class, mappedBy="categorie")
*/
private $questionTestB1s;
public function __construct()
{
$this->questionTestB1s = new ArrayCollection();
}
public function __toString()
{
return $this->wording;
}
public function getId(): ?int
{
return $this->id;
}
public function getWording(): ?string
{
return $this->wording;
}
public function setWording(string $wording): self
{
$this->wording = $wording;
return $this;
}
/**
* @return Collection<int, QuestionTestB1>
*/
public function getQuestionTestB1s(): Collection
{
return $this->questionTestB1s;
}
public function addQuestionTestB1(QuestionTestB1 $questionTestB1): self
{
if (!$this->questionTestB1s->contains($questionTestB1)) {
$this->questionTestB1s[] = $questionTestB1;
$questionTestB1->setCategorie($this);
}
return $this;
}
public function removeQuestionTestB1(QuestionTestB1 $questionTestB1): self
{
if ($this->questionTestB1s->removeElement($questionTestB1)) {
// set the owning side to null (unless already changed)
if ($questionTestB1->getCategorie() === $this) {
$questionTestB1->setCategorie(null);
}
}
return $this;
}
}