<?php
declare(strict_types=1);
namespace App\Entity;
use App\Repository\CommuneRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
* Commune.
*
* @ORM\Table(name="Commune")
*
* @ORM\Entity(repositoryClass=CommuneRepository::class)
*/
class Commune
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
*
* @ORM\Id
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="nom", type="string", length=255)
*/
private $nom;
/**
* @var string
*
* @ORM\Column(name="nom_insee", type="string", length=255)
*/
private $nom_insee;
/**
* @var int
*
* @ORM\Column(name="population", type="integer")
*/
private $population;
/**
* @var string
*
* @ORM\Column(name="insee", type="string", length=5)
*/
private $insee;
/**
* @var string
*
* @ORM\Column(name="codePostal", type="string", length=5)
*/
private $codePostal;
/**
* @var string
*
* @ORM\Column(name="aucode", type="string", length=3)
*/
private $aucode;
/**
* @var string
*
* @ORM\Column(name="aulibelle", type="string", length=255)
*/
private $aulibelle;
/**
* @var float
*
* @ORM\Column(name="latitude", type="decimal", precision=10, scale=8)
*/
private $latitude;
/**
* @var float
*
* @ORM\Column(name="longitude", type="decimal", precision=10, scale=8)
*/
private $longitude;
/**
* @ORM\OneToMany(targetEntity="Structure", mappedBy="communeImplementation")
*/
private $structuresImplementes;
/**
* @ORM\ManyToMany(targetEntity="Structure", mappedBy="communesZoneInfluence")
*/
private $structuresZoneInfluence;
/**
* @ORM\ManyToOne(targetEntity="Departement", inversedBy="communes")
*
* @ORM\JoinColumn(name="departement_id", referencedColumnName="id")
*/
private $departement;
/**
* Constructor.
*/
public function __construct()
{
$this->structuresImplementes = new \Doctrine\Common\Collections\ArrayCollection();
$this->structuresZoneInfluence = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Methode pour afficher la commune.
*/
#[\Override]
public function __toString(): string
{
if ('' != $this->getNom()) {
return $this->nom;
} else {
return ' ';
}
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set nom.
*
* @param string $nom
*/
public function setNom($nom): static
{
$this->nom = $nom;
return $this;
}
/**
* Get nom.
*
* @return string
*/
public function getNom()
{
return $this->nom;
}
/**
* Set population.
*
* @param int $population
*/
public function setPopulation($population): static
{
$this->population = $population;
return $this;
}
/**
* Get population.
*
* @return int
*/
public function getPopulation()
{
return $this->population;
}
/**
* Set insee.
*
* @param string $insee
*/
public function setInsee($insee): static
{
$this->insee = $insee;
return $this;
}
/**
* Get insee.
*
* @return string
*/
public function getInsee()
{
return $this->insee;
}
/**
* Set latitude.
*
* @param float $latitude
*/
public function setLatitude($latitude): static
{
$this->latitude = $latitude;
return $this;
}
/**
* Get latitude.
*
* @return float
*/
public function getLatitude()
{
return $this->latitude;
}
/**
* Set longitude.
*
* @param float $longitude
*/
public function setLongitude($longitude): static
{
$this->longitude = $longitude;
return $this;
}
/**
* Get longitude.
*
* @return float
*/
public function getLongitude()
{
return $this->longitude;
}
/**
* Add structuresImplementes.
*/
public function addStructuresImplemente(Structure $structuresImplementes): static
{
$this->structuresImplementes[] = $structuresImplementes;
return $this;
}
/**
* Remove structuresImplementes.
*/
public function removeStructuresImplemente(Structure $structuresImplementes): void
{
$this->structuresImplementes->removeElement($structuresImplementes);
}
/**
* Get structuresImplementes.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getStructuresImplementes()
{
return $this->structuresImplementes;
}
/**
* Add structuresZoneInfluence.
*/
public function addStructuresZoneInfluence(Structure $structuresZoneInfluence): static
{
$this->structuresZoneInfluence[] = $structuresZoneInfluence;
return $this;
}
/**
* Remove structuresZoneInfluence.
*/
public function removeStructuresZoneInfluence(Structure $structuresZoneInfluence): void
{
$this->structuresZoneInfluence->removeElement($structuresZoneInfluence);
}
/**
* Get structuresZoneInfluence.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getStructuresZoneInfluence()
{
return $this->structuresZoneInfluence;
}
/**
* Set departement.
*/
public function setDepartement(?Departement $departement = null): static
{
$this->departement = $departement;
return $this;
}
/**
* Get departement.
*
* @return Departement
*/
public function getDepartement()
{
return $this->departement;
}
/**
* Set aucode.
*
* @param string $aucode
*/
public function setAucode($aucode): static
{
$this->aucode = $aucode;
return $this;
}
/**
* Get aucode.
*
* @return string
*/
public function getAucode()
{
return $this->aucode;
}
/**
* Set aulibelle.
*
* @param string $aulibelle
*/
public function setAulibelle($aulibelle): static
{
$this->aulibelle = $aulibelle;
return $this;
}
/**
* Get aulibelle.
*
* @return string
*/
public function getAulibelle()
{
return $this->aulibelle;
}
/**
* Set nom_insee.
*
* @param string $nomInsee
*/
public function setNomInsee($nomInsee): static
{
$this->nom_insee = $nomInsee;
return $this;
}
/**
* Get nom_insee.
*
* @return string
*/
public function getNomInsee()
{
return $this->nom_insee;
}
/**
* Set codePostal.
*
* @param string $codePostal
*/
public function setCodePostal($codePostal): static
{
$this->codePostal = $codePostal;
return $this;
}
/**
* Get codePostal.
*
* @return string
*/
public function getCodePostal()
{
return $this->codePostal;
}
}