<?php
namespace App\Entity;
use App\Repository\VillesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=VillesRepository::class)
*/
class Villes
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $VilleNomReel;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $VilleNom;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $VilleCodePostal;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $VilleLongitudeDeg;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $VilleLatitudeDeg;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $VilleSlug;
/**
* @ORM\ManyToOne(targetEntity=Departements::class, inversedBy="villes")
*/
private $Departements;
/**
* @ORM\OneToMany(targetEntity=Alertes::class, mappedBy="Villes")
*/
private $alertes;
/**
* @ORM\OneToMany(targetEntity=Annonces::class, mappedBy="Villes")
*/
private $annonces;
/**
* @ORM\OneToMany(targetEntity=User::class, mappedBy="Villes")
*/
private $users;
public function __construct()
{
$this->alertes = new ArrayCollection();
$this->annonces = new ArrayCollection();
$this->users = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getVilleNomReel(): ?string
{
return $this->VilleNomReel;
}
public function setVilleNomReel(?string $VilleNomReel): self
{
$this->VilleNomReel = $VilleNomReel;
return $this;
}
public function getVilleNom(): ?string
{
return $this->VilleNom;
}
public function setVilleNom(?string $VilleNom): self
{
$this->VilleNom = $VilleNom;
return $this;
}
public function getVilleCodePostal(): ?string
{
return $this->VilleCodePostal;
}
public function setVilleCodePostal(?string $VilleCodePostal): self
{
$this->VilleCodePostal = $VilleCodePostal;
return $this;
}
public function getVilleLongitudeDeg(): ?string
{
return $this->VilleLongitudeDeg;
}
public function setVilleLongitudeDeg(?string $VilleLongitudeDeg): self
{
$this->VilleLongitudeDeg = $VilleLongitudeDeg;
return $this;
}
public function getVilleLatitudeDeg(): ?string
{
return $this->VilleLatitudeDeg;
}
public function setVilleLatitudeDeg(?string $VilleLatitudeDeg): self
{
$this->VilleLatitudeDeg = $VilleLatitudeDeg;
return $this;
}
public function getVilleSlug(): ?string
{
return $this->VilleSlug;
}
public function setVilleSlug(?string $VilleSlug): self
{
$this->VilleSlug = $VilleSlug;
return $this;
}
public function getDepartements(): ?Departements
{
return $this->Departements;
}
public function setDepartements(?Departements $Departements): self
{
$this->Departements = $Departements;
return $this;
}
/**
* @return Collection<int, Alertes>
*/
public function getAlertes(): Collection
{
return $this->alertes;
}
public function addAlerte(Alertes $alerte): self
{
if (!$this->alertes->contains($alerte)) {
$this->alertes[] = $alerte;
$alerte->setVilles($this);
}
return $this;
}
public function removeAlerte(Alertes $alerte): self
{
if ($this->alertes->removeElement($alerte)) {
// set the owning side to null (unless already changed)
if ($alerte->getVilles() === $this) {
$alerte->setVilles(null);
}
}
return $this;
}
/**
* @return Collection<int, Annonces>
*/
public function getAnnonces(): Collection
{
return $this->annonces;
}
public function addAnnonce(Annonces $annonce): self
{
if (!$this->annonces->contains($annonce)) {
$this->annonces[] = $annonce;
$annonce->setVilles($this);
}
return $this;
}
public function removeAnnonce(Annonces $annonce): self
{
if ($this->annonces->removeElement($annonce)) {
// set the owning side to null (unless already changed)
if ($annonce->getVilles() === $this) {
$annonce->setVilles(null);
}
}
return $this;
}
/**
* @return Collection<int, User>
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(User $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
$user->setVilles($this);
}
return $this;
}
public function removeUser(User $user): self
{
if ($this->users->removeElement($user)) {
// set the owning side to null (unless already changed)
if ($user->getVilles() === $this) {
$user->setVilles(null);
}
}
return $this;
}
}