follow up graphs

This commit is contained in:
Tykayn 2025-06-29 15:56:55 +02:00 committed by tykayn
parent 4b4a46c3f7
commit ab1b9a9d3d
11 changed files with 580 additions and 41 deletions

View file

@ -98,8 +98,11 @@ class Stats
#[ORM\Column(type: Types::DECIMAL, precision: 15, scale: 2, nullable: true)]
private ?string $budget_annuel = null;
#[ORM\ManyToOne(inversedBy: 'stats')]
private ?CityFollowUp $cityFollowUps = null;
/**
* @var Collection<int, CityFollowUp>
*/
#[ORM\OneToMany(mappedBy: 'stats', targetEntity: CityFollowUp::class, cascade: ['persist', 'remove'])]
private Collection $cityFollowUps;
public function getCTCurlBase(): ?string
{
@ -251,6 +254,7 @@ class Stats
{
$this->places = new ArrayCollection();
$this->statsHistories = new ArrayCollection();
$this->cityFollowUps = new ArrayCollection();
}
public function getId(): ?int
@ -569,15 +573,30 @@ class Stats
return $this;
}
public function getCityFollowUps(): ?CityFollowUp
/**
* @return Collection<int, CityFollowUp>
*/
public function getCityFollowUps(): Collection
{
return $this->cityFollowUps;
}
public function setCityFollowUps(?CityFollowUp $cityFollowUps): static
public function addCityFollowUp(CityFollowUp $cityFollowUp): static
{
$this->cityFollowUps = $cityFollowUps;
if (!$this->cityFollowUps->contains($cityFollowUp)) {
$this->cityFollowUps->add($cityFollowUp);
$cityFollowUp->setStats($this);
}
return $this;
}
public function removeCityFollowUp(CityFollowUp $cityFollowUp): static
{
if ($this->cityFollowUps->removeElement($cityFollowUp)) {
if ($cityFollowUp->getStats() === $this) {
$cityFollowUp->setStats(null);
}
}
return $this;
}