created = new \DateTime(); $this->players = new ArrayCollection(); $this->settings = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getGame(): ?Game { return $this->game; } public function setGame(?Game $game): static { $this->game = $game; return $this; } public function getStatus(): ?SessionStatus { return $this->status; } public function setStatus(SessionStatus $status): static { $this->status = $status; return $this; } public function getTimer(): ?int { return $this->timer; } public function setTimer(int $timer): static { $this->timer = $timer; return $this; } public function getCreated(): ?\DateTimeInterface { return $this->created; } public function setCreated(\DateTimeInterface $created): static { $this->created = $created; return $this; } /** * @return Collection */ public function getPlayers(): Collection { return $this->players; } public function addPlayer(Player $player): static { if (!$this->players->contains($player)) { $this->players->add($player); $player->setSession($this); } return $this; } public function removePlayer(Player $player): static { if ($this->players->removeElement($player)) { // set the owning side to null (unless already changed) if ($player->getSession() === $this) { $player->setSession(null); } } return $this; } /** * @return Collection */ public function getSettings(): Collection { return $this->settings; } public function addSetting(SessionSetting $setting): static { if (!$this->settings->contains($setting)) { $this->settings->add($setting); $setting->setSession($this); } return $this; } public function removeSetting(SessionSetting $setting): static { if ($this->settings->removeElement($setting)) { // set the owning side to null (unless already changed) if ($setting->getSession() === $this) { $setting->setSession(null); } } return $this; } }