*/ #[ORM\OneToMany(targetEntity: Quiz::class, mappedBy: 'season', cascade: ['persist'], orphanRemoval: true)] private Collection $quizzes; /** @var Collection */ #[ORM\OneToMany(targetEntity: Candidate::class, mappedBy: 'season', cascade: ['persist'], orphanRemoval: true)] private Collection $candidates; /** @var Collection */ #[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'seasons')] private Collection $owners; #[ORM\ManyToOne] private ?Quiz $ActiveQuiz = null; public function __construct() { $this->quizzes = new ArrayCollection(); $this->candidates = new ArrayCollection(); $this->owners = new ArrayCollection(); } public function getId(): ?Uuid { return $this->id; } public function getName(): string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } public function getSeasonCode(): ?string { return $this->seasonCode; } public function setSeasonCode(string $seasonCode): static { $this->seasonCode = $seasonCode; return $this; } /** @return Collection */ public function getQuizzes(): Collection { return $this->quizzes; } public function addQuiz(Quiz $quiz): static { if (!$this->quizzes->contains($quiz)) { $this->quizzes->add($quiz); $quiz->setSeason($this); } return $this; } /** @return Collection */ public function getCandidates(): Collection { return $this->candidates; } public function addCandidate(Candidate $candidate): static { if (!$this->candidates->contains($candidate)) { $this->candidates->add($candidate); $candidate->setSeason($this); } return $this; } /** @return Collection */ public function getOwners(): Collection { return $this->owners; } public function addOwner(User $owner): static { if (!$this->owners->contains($owner)) { $this->owners->add($owner); } return $this; } public function removeOwner(User $owner): static { $this->owners->removeElement($owner); return $this; } public function getActiveQuiz(): ?Quiz { return $this->ActiveQuiz; } public function setActiveQuiz(?Quiz $ActiveQuiz): static { $this->ActiveQuiz = $ActiveQuiz; return $this; } public function isOwner(User $user): bool { return $this->owners->contains($user); } }