mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-09 17:02:46 +02:00
follow up graphs
This commit is contained in:
parent
4b4a46c3f7
commit
ab1b9a9d3d
11 changed files with 580 additions and 41 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue