seasons = new ArrayCollection(); $this->seasonData = new ArrayCollection(); $this->players = 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 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 { $this->createdAt = new \DateTimeImmutable(); } /** * @return Collection */ public function getSeasons(): Collection { return $this->seasons; } public function addSeason(Season $season): static { if (!$this->seasons->contains($season)) { $this->seasons->add($season); $season->addTeam($this); } return $this; } public function removeSeason(Season $season): static { if ($this->seasons->removeElement($season)) { $season->removeTeam($this); } return $this; } /** * @return Collection */ public function getSeasonData(): Collection { return $this->seasonData; } public function addSeasonData(SeasonData $seasonData): static { if (!$this->seasonData->contains($seasonData)) { $this->seasonData->add($seasonData); $seasonData->setTeam($this); } return $this; } public function removeSeasonData(SeasonData $seasonData): static { if ($this->seasonData->removeElement($seasonData)) { // set the owning side to null (unless already changed) if ($seasonData->getTeam() === $this) { $seasonData->setTeam(null); } } 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->setTeam($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->getTeam() === $this) { $player->setTeam(null); } } return $this; } public function getCaptain(): ?User { return $this->captain; } public function setCaptain(?User $captain): static { $this->captain = $captain; return $this; } public function getHomeFacility(): ?Facility { return $this->homeFacility; } public function setHomeFacility(?Facility $homeFacility): static { $this->homeFacility = $homeFacility; return $this; } }