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

@ -3,8 +3,6 @@
namespace App\Entity;
use App\Repository\CityFollowUpRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CityFollowUpRepository::class)]
@ -24,16 +22,8 @@ class CityFollowUp
#[ORM\Column]
private ?\DateTime $date = null;
/**
* @var Collection<int, Stats>
*/
#[ORM\OneToMany(targetEntity: Stats::class, mappedBy: 'cityFollowUps')]
private Collection $stats;
public function __construct()
{
$this->stats = new ArrayCollection();
}
#[ORM\ManyToOne(targetEntity: Stats::class, inversedBy: 'cityFollowUps')]
private ?Stats $stats = null;
public function getId(): ?int
{
@ -76,33 +66,14 @@ class CityFollowUp
return $this;
}
/**
* @return Collection<int, Stats>
*/
public function getStats(): Collection
public function getStats(): ?Stats
{
return $this->stats;
}
public function addStat(Stats $stat): static
public function setStats(?Stats $stats): static
{
if (!$this->stats->contains($stat)) {
$this->stats->add($stat);
$stat->setCityFollowUps($this);
}
return $this;
}
public function removeStat(Stats $stat): static
{
if ($this->stats->removeElement($stat)) {
// set the owning side to null (unless already changed)
if ($stat->getCityFollowUps() === $this) {
$stat->setCityFollowUps(null);
}
}
$this->stats = $stats;
return $this;
}
}