sessions = new ArrayCollection(); $this->settings = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } public function getNumberOfPlayers(): ?int { return $this->numberOfPlayers; } public function setNumberOfPlayers(int $numberOfPlayers): static { $this->numberOfPlayers = $numberOfPlayers; return $this; } public function getStatus(): ?GameStatus { return $this->status; } public function setStatus(GameStatus $status): static { $this->status = $status; return $this; } /** * @return Collection */ public function getSessions(): Collection { return $this->sessions; } public function addSession(Session $session): static { if (!$this->sessions->contains($session)) { $this->sessions->add($session); $session->setGame($this); } return $this; } public function removeSession(Session $session): static { if ($this->sessions->removeElement($session)) { // set the owning side to null (unless already changed) if ($session->getGame() === $this) { $session->setGame(null); } } return $this; } /** * @return Collection */ public function getSettings(): Collection { return $this->settings; } public function addSetting(GameSetting $setting): static { if (!$this->settings->contains($setting)) { $this->settings->add($setting); $setting->setGame($this); } return $this; } public function removeSetting(GameSetting $setting): static { if ($this->settings->removeElement($setting)) { // set the owning side to null (unless already changed) if ($setting->getGame() === $this) { $setting->setGame(null); } } return $this; } }