Mysaa 145f4aa7fd
Mise à jour de symfony
Mise à jour de PHP
Correction des entitées from attributes to annotations
Ajout des entitées des objets 3D
2023-01-17 17:27:49 +01:00

91 lines
1.9 KiB
PHP

<?php
namespace App\Entity;
use App\Repository\SiteRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: SiteRepository::class)]
class Site
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: "integer")]
private $id;
#[ORM\Column(type: "float")]
private $zeroLatitude;
#[ORM\Column(type: "float")]
private $zeroLongitude;
#[ORM\OneToMany(targetEntity: Building::class, mappedBy: "site")]
private $buildings;
public function __construct()
{
$this->buildings = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getZeroLatitude(): ?float
{
return $this->zeroLatitude;
}
public function setZeroLatitude(float $zeroLatitude): self
{
$this->zeroLatitude = $zeroLatitude;
return $this;
}
public function getZeroLongitude(): ?float
{
return $this->zeroLongitude;
}
public function setZeroLongitude(float $zeroLongitude): self
{
$this->zeroLongitude = $zeroLongitude;
return $this;
}
/**
* @return Collection<int, Building>
*/
public function getBuildings(): Collection
{
return $this->buildings;
}
public function addBuilding(Building $building): self
{
if (!$this->buildings->contains($building)) {
$this->buildings[] = $building;
$building->setSite($this);
}
return $this;
}
public function removeBuilding(Building $building): self
{
if ($this->buildings->removeElement($building)) {
// set the owning side to null (unless already changed)
if ($building->getSite() === $this) {
$building->setSite(null);
}
}
return $this;
}
}