*/ #[ORM\ManyToMany(targetEntity: Answer::class, mappedBy: 'candidates')] private Collection $answersOnCandidate; /** @var Collection */ #[ORM\OneToMany(targetEntity: GivenAnswer::class, mappedBy: 'candidate', orphanRemoval: true)] private Collection $givenAnswers; /** @var Collection */ #[ORM\OneToMany(targetEntity: QuizCandidate::class, mappedBy: 'candidate', orphanRemoval: true)] private Collection $quizData; public function __construct( #[ORM\Column(length: 16)] private string $name, ) { $this->answersOnCandidate = new ArrayCollection(); $this->givenAnswers = new ArrayCollection(); $this->quizData = new ArrayCollection(); } public function getId(): Uuid { return $this->id; } public function getSeason(): Season { return $this->season; } public function setSeason(Season $season): static { $this->season = $season; return $this; } public function getName(): string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } /** @return Collection */ public function getAnswersOnCandidate(): Collection { return $this->answersOnCandidate; } public function addAnswersOnCandidate(Answer $answersOnCandidate): static { if (!$this->answersOnCandidate->contains($answersOnCandidate)) { $this->answersOnCandidate->add($answersOnCandidate); $answersOnCandidate->addCandidate($this); } return $this; } public function removeAnswersOnCandidate(Answer $answersOnCandidate): static { if ($this->answersOnCandidate->removeElement($answersOnCandidate)) { $answersOnCandidate->removeCandidate($this); } return $this; } /** @return Collection */ public function getGivenAnswers(): Collection { return $this->givenAnswers; } /** @return Collection */ public function getQuizData(): Collection { return $this->quizData; } public function getNameHash(): string { return Base64::base64UrlEncode($this->name); } }