teams = new ArrayCollection(); $this->games = new ArrayCollection(); $this->facilities = new ArrayCollection(); $this->files = new ArrayCollection(); } public function getId(): ?int { return $this->id; } /** * @return Collection */ public function getTeams(): Collection { return $this->teams; } public function addTeam(Team $team): static { if (!$this->teams->contains($team)) { $this->teams->add($team); } return $this; } public function removeTeam(Team $team): static { $this->teams->removeElement($team); return $this; } public function getDateStart(): ?\DateTimeInterface { return $this->dateStart; } public function setDateStart(\DateTimeInterface $dateStart): static { $this->dateStart = $dateStart; return $this; } public function getDateEnd(): ?\DateTimeInterface { return $this->dateEnd; } public function setDateEnd(?\DateTimeInterface $dateEnd): static { $this->dateEnd = $dateEnd; return $this; } public function isActive(): ?bool { return $this->active; } public function setActive(?bool $active): static { $this->active = $active; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->createdAt; } #[ORM\PrePersist] public function setCreatedAt(): void { $timezone = new \DateTimeZone('Europe/Madrid'); $this->createdAt = new \DateTimeImmutable('now', $timezone); } public function getLeague(): ?League { return $this->league; } public function setLeague(?League $league): static { $this->league = $league; return $this; } /** * @return Collection */ public function getGames(): Collection { return $this->games; } public function addGame(Game $game): static { if (!$this->games->contains($game)) { $this->games->add($game); $game->setSeason($this); } return $this; } public function removeGame(Game $game): static { if ($this->games->removeElement($game)) { // set the owning side to null (unless already changed) if ($game->getSeason() === $this) { $game->setSeason(null); } } return $this; } /** * @return Collection */ public function getFacilities(): Collection { return $this->facilities; } public function addFacility(Facility $facility): static { if (!$this->facilities->contains($facility)) { $this->facilities->add($facility); $facility->setSeason($this); } return $this; } public function removeFacility(Facility $facility): static { if ($this->facilities->removeElement($facility)) { // set the owning side to null (unless already changed) if ($facility->getSeason() === $this) { $facility->setSeason(null); } } return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeInterface $updatedAt): static { $this->updatedAt = $updatedAt; return $this; } /** * @return Collection */ public function getFiles(): Collection { return $this->files; } public function addFile(File $file): static { if (!$this->files->contains($file)) { $this->files->add($file); $file->setSeason($this); } return $this; } public function removeFile(File $file): static { if ($this->files->removeElement($file)) { // set the owning side to null (unless already changed) if ($file->getSeason() === $this) { $file->setSeason(null); } } return $this; } }