mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-09 17:02:46 +02:00
add history on stats
This commit is contained in:
parent
7fb0c9c8c2
commit
b61fa6a287
11 changed files with 502 additions and 37 deletions
|
@ -16,10 +16,10 @@ class Stats
|
|||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255, type: Types::STRING, nullable: true)]
|
||||
private ?string $zone = null; // code insee de la zone
|
||||
|
||||
#[ORM\Column(type: Types::SMALLINT)]
|
||||
#[ORM\Column(type: Types::INTEGER, nullable: true)]
|
||||
private ?int $completion_percent = null;
|
||||
|
||||
/**
|
||||
|
@ -29,27 +29,27 @@ class Stats
|
|||
private Collection $places;
|
||||
|
||||
// nombre de commerces dans la zone
|
||||
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
|
||||
#[ORM\Column(type: Types::INTEGER, nullable: true)]
|
||||
private ?int $places_count = null;
|
||||
|
||||
// nombre de commerces avec horaires
|
||||
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
|
||||
#[ORM\Column(type: Types::INTEGER, nullable: true)]
|
||||
private ?int $avec_horaires = null;
|
||||
|
||||
// nombre de commerces avec adresse
|
||||
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
|
||||
#[ORM\Column(type: Types::INTEGER, nullable: true)]
|
||||
private ?int $avec_adresse = null;
|
||||
|
||||
// nombre de commerces avec site
|
||||
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
|
||||
#[ORM\Column(type: Types::INTEGER, nullable: true)]
|
||||
private ?int $avec_site = null;
|
||||
|
||||
// nombre de commerces avec accessibilité
|
||||
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
|
||||
#[ORM\Column(type: Types::INTEGER, nullable: true)]
|
||||
private ?int $avec_accessibilite = null;
|
||||
|
||||
// nombre de commerces avec note
|
||||
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
|
||||
#[ORM\Column(type: Types::INTEGER, nullable: true)]
|
||||
private ?int $avec_note = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
|
@ -59,10 +59,10 @@ class Stats
|
|||
#[ORM\Column(type: Types::INTEGER, nullable: true)]
|
||||
private ?int $population = null;
|
||||
|
||||
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
|
||||
#[ORM\Column(type: Types::INTEGER, nullable: true)]
|
||||
private ?int $siren = null;
|
||||
|
||||
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
|
||||
#[ORM\Column(type: Types::INTEGER, nullable: true)]
|
||||
private ?int $codeEpci = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
|
@ -74,6 +74,18 @@ class Stats
|
|||
#[ORM\OneToMany(targetEntity: StatsHistory::class, mappedBy: 'stats')]
|
||||
private Collection $statsHistories;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTime $date_created = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTime $date_modified = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $avec_siret = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $avec_name = null;
|
||||
|
||||
// calcule le pourcentage de complétion de la zone
|
||||
public function computeCompletionPercent(): ?int
|
||||
{
|
||||
|
@ -352,6 +364,54 @@ class Stats
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDateCreated(): ?\DateTime
|
||||
{
|
||||
return $this->date_created;
|
||||
}
|
||||
|
||||
public function setDateCreated(?\DateTime $date_created): static
|
||||
{
|
||||
$this->date_created = $date_created;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDateModified(): ?\DateTime
|
||||
{
|
||||
return $this->date_modified;
|
||||
}
|
||||
|
||||
public function setDateModified(?\DateTime $date_modified): static
|
||||
{
|
||||
$this->date_modified = $date_modified;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAvecSiret(): ?int
|
||||
{
|
||||
return $this->avec_siret;
|
||||
}
|
||||
|
||||
public function setAvecSiret(?int $avec_siret): static
|
||||
{
|
||||
$this->avec_siret = $avec_siret;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAvecName(): ?int
|
||||
{
|
||||
return $this->avec_name;
|
||||
}
|
||||
|
||||
public function setAvecName(?int $avec_name): static
|
||||
{
|
||||
$this->avec_name = $avec_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -29,6 +29,24 @@ class StatsHistory
|
|||
#[ORM\ManyToOne(inversedBy: 'statsHistories')]
|
||||
private ?Stats $stats = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?\DateTime $date = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $names_count = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $opening_hours_count = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $website_count = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $address_count = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $siret_count = null;
|
||||
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
|
@ -95,4 +113,76 @@ class StatsHistory
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getDate(): ?\DateTime
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
public function setDate(\DateTime $date): static
|
||||
{
|
||||
$this->date = $date;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNamesCount(): ?int
|
||||
{
|
||||
return $this->names_count;
|
||||
}
|
||||
|
||||
public function setNamesCount(?int $names_count): static
|
||||
{
|
||||
$this->names_count = $names_count;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOpeningHoursCount(): ?int
|
||||
{
|
||||
return $this->opening_hours_count;
|
||||
}
|
||||
|
||||
public function setOpeningHoursCount(?int $opening_hours_count): static
|
||||
{
|
||||
$this->opening_hours_count = $opening_hours_count;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWebsiteCount(): ?int
|
||||
{
|
||||
return $this->website_count;
|
||||
}
|
||||
|
||||
public function setWebsiteCount(?int $website_count): static
|
||||
{
|
||||
$this->website_count = $website_count;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAddressCount(): ?int
|
||||
{
|
||||
return $this->address_count;
|
||||
}
|
||||
|
||||
public function setAddressCount(?int $address_count): static
|
||||
{
|
||||
$this->address_count = $address_count;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSiretCount(): ?int
|
||||
{
|
||||
return $this->siret_count;
|
||||
}
|
||||
|
||||
public function setSiretCount(?int $siret_count): static
|
||||
{
|
||||
$this->siret_count = $siret_count;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue