*/ #[ORM\OneToMany(targetEntity: Place::class, mappedBy: 'stats')] private Collection $places; #[ORM\Column(type: Types::SMALLINT)] private ?int $places_count = null; public function __construct() { $this->places = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getZone(): ?string { return $this->zone; } public function setZone(string $zone): static { $this->zone = $zone; return $this; } public function getCompletionPercent(): ?int { return $this->completion_percent; } public function setCompletionPercent(int $completion_percent): static { $this->completion_percent = $completion_percent; return $this; } /** * @return Collection */ public function getPlaces(): Collection { return $this->places; } public function addPlace(Place $place): static { if (!$this->places->contains($place)) { $this->places->add($place); $place->setStats($this); } return $this; } public function removePlace(Place $place): static { if ($this->places->removeElement($place)) { // set the owning side to null (unless already changed) if ($place->getStats() === $this) { $place->setStats(null); } } return $this; } public function getPlacesCount(): ?int { return $this->places_count; } public function setPlacesCount(int $places_count): static { $this->places_count = $places_count; return $this; } }