<?php
namespace App\Entity;
use App\Repository\VilleRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: VilleRepository::class)]
class Ville
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $nom;
#[ORM\OneToMany(mappedBy: 'ville', targetEntity: OffreEmploi::class)]
private $offreEmplois;
#[ORM\OneToMany(mappedBy: 'ville', targetEntity: RepriseActivite::class)]
private $repriseActivites;
#[ORM\OneToMany(mappedBy: 'ville', targetEntity: OffreImmobiliere::class)]
private $offreImmobilieres;
public function __construct()
{
$this->offreEmplois = new ArrayCollection();
$this->repriseActivites = new ArrayCollection();
$this->offreImmobilieres = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(?string $nom): self
{
$this->nom = $nom;
return $this;
}
/**
* @return Collection<int, OffreEmploi>
*/
public function getOffreEmplois(): Collection
{
return $this->offreEmplois;
}
public function addOffreEmploi(OffreEmploi $offreEmploi): self
{
if (!$this->offreEmplois->contains($offreEmploi)) {
$this->offreEmplois[] = $offreEmploi;
$offreEmploi->setVille($this);
}
return $this;
}
public function removeOffreEmploi(OffreEmploi $offreEmploi): self
{
if ($this->offreEmplois->removeElement($offreEmploi)) {
// set the owning side to null (unless already changed)
if ($offreEmploi->getVille() === $this) {
$offreEmploi->setVille(null);
}
}
return $this;
}
/**
* @return Collection<int, RepriseActivite>
*/
public function getRepriseActivites(): Collection
{
return $this->repriseActivites;
}
public function addRepriseActivite(RepriseActivite $repriseActivite): self
{
if (!$this->repriseActivites->contains($repriseActivite)) {
$this->repriseActivites[] = $repriseActivite;
$repriseActivite->setVille($this);
}
return $this;
}
public function removeRepriseActivite(RepriseActivite $repriseActivite): self
{
if ($this->repriseActivites->removeElement($repriseActivite)) {
// set the owning side to null (unless already changed)
if ($repriseActivite->getVille() === $this) {
$repriseActivite->setVille(null);
}
}
return $this;
}
/**
* @return Collection<int, OffreImmobiliere>
*/
public function getOffreImmobilieres(): Collection
{
return $this->offreImmobilieres;
}
public function addOffreImmobiliere(OffreImmobiliere $offreImmobiliere): self
{
if (!$this->offreImmobilieres->contains($offreImmobiliere)) {
$this->offreImmobilieres[] = $offreImmobiliere;
$offreImmobiliere->setVille($this);
}
return $this;
}
public function removeOffreImmobiliere(OffreImmobiliere $offreImmobiliere): self
{
if ($this->offreImmobilieres->removeElement($offreImmobiliere)) {
// set the owning side to null (unless already changed)
if ($offreImmobiliere->getVille() === $this) {
$offreImmobiliere->setVille(null);
}
}
return $this;
}
}