mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-04 17:04:53 +02:00
108 lines
2.1 KiB
PHP
108 lines
2.1 KiB
PHP
<?php
|
|
|
|
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)]
|
|
class CityFollowUp
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column]
|
|
private ?int $id = null;
|
|
|
|
#[ORM\Column(length: 255)]
|
|
private ?string $name = null;
|
|
|
|
#[ORM\Column]
|
|
private ?float $measure = null;
|
|
|
|
#[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();
|
|
}
|
|
|
|
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 getMeasure(): ?float
|
|
{
|
|
return $this->measure;
|
|
}
|
|
|
|
public function setMeasure(float $measure): static
|
|
{
|
|
$this->measure = $measure;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDate(): ?\DateTime
|
|
{
|
|
return $this->date;
|
|
}
|
|
|
|
public function setDate(\DateTime $date): static
|
|
{
|
|
$this->date = $date;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection<int, Stats>
|
|
*/
|
|
public function getStats(): Collection
|
|
{
|
|
return $this->stats;
|
|
}
|
|
|
|
public function addStat(Stats $stat): 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);
|
|
}
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
}
|