Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.coaching-en-developpement-personnel.fr
/
htdocs
/
src
/
Entity
/
/srv/data/web/vhosts/www.coaching-en-developpement-personnel.fr/htdocs/src/Entity/Question.php
<?php namespace App\Entity; use App\Repository\QuestionRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity(repositoryClass=QuestionRepository::class) */ class Question { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\ManyToOne(targetEntity=Chapter::class, inversedBy="questions") * @ORM\JoinColumn(nullable=false) */ private $chapter; /** * @ORM\Column(type="integer") */ private $questionOrder; /** * @ORM\OneToMany(targetEntity=Answer::class, mappedBy="question") */ private $answers; /** * @ORM\Column(type="text", nullable=true) */ private $explication; public function __construct() { $this->responses = new ArrayCollection(); $this->answers = 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 getChapter(): ?Chapter { return $this->chapter; } public function setChapter(?Chapter $chapter): self { $this->chapter = $chapter; return $this; } public function getQuestionOrder(): ?int { return $this->questionOrder; } public function setQuestionOrder(int $questionOrder): self { $this->questionOrder = $questionOrder; return $this; } /** * @return Collection|Answer[] */ public function getAnswers(): Collection { return $this->answers; } public function addAnswer(Answer $answer): self { if (!$this->answers->contains($answer)) { $this->answers[] = $answer; $answer->setQuestion($this); } return $this; } public function removeAnswer(Answer $answer): self { if ($this->answers->removeElement($answer)) { // set the owning side to null (unless already changed) if ($answer->getQuestion() === $this) { $answer->setQuestion(null); } } return $this; } public function getExplication(): ?string { return $this->explication; } public function setExplication(?string $explication): self { $this->explication = $explication; return $this; } }