games = new ArrayCollection(); $this->teams = 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 getAddress(): ?string { return $this->address; } public function setAddress(?string $address): static { $this->address = $address; 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->setFacility($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->getFacility() === $this) { $game->setFacility(null); } } return $this; } public function getSeason(): ?Season { return $this->season; } public function setSeason(?Season $season): static { $this->season = $season; 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 isActive(): ?bool { return $this->active; } public function setActive(?bool $active): static { $this->active = $active; return $this; } public function getAvailableHours(): ?array { return $this->availableHours; } public function setAvailableHours(?array $availableHours): static { $this->availableHours = $availableHours; return $this; } /** * @return Collection */ public function getTeams(): Collection { return $this->teams; } public function addTeam(Team $team): static { if (!$this->teams->contains($team)) { $this->teams->add($team); $team->setHomeFacility($this); } return $this; } public function removeTeam(Team $team): static { if ($this->teams->removeElement($team)) { // set the owning side to null (unless already changed) if ($team->getHomeFacility() === $this) { $team->setHomeFacility(null); } } return $this; } }