<?php
namespace App\Entity;
use App\Repository\QuartiersRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: QuartiersRepository::class)]
class Quartiers
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column()]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $code = null;
#[ORM\Column(length: 255)]
private ?string $slug = null;
#[ORM\Column(length: 255)]
private ?string $nom = null;
#[ORM\ManyToOne(inversedBy: 'quartiers')]
#[ORM\JoinColumn(nullable: false)]
private ?Villes $ville = null;
#[ORM\Column(nullable: true)]
private ?bool $isStatus = null;
#[ORM\OneToMany(mappedBy: 'quartier', targetEntity: Immeubles::class)]
private Collection $immeubles;
public function __construct()
{
$this->immeubles = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getVille(): ?Villes
{
return $this->ville;
}
public function setVille(?Villes $ville): self
{
$this->ville = $ville;
return $this;
}
public function isIsStatus(): ?bool
{
return $this->isStatus;
}
public function setIsStatus(?bool $isStatus): self
{
$this->isStatus = $isStatus;
return $this;
}
/**
* @return Collection<int, Immeubles>
*/
public function getImmeubles(): Collection
{
return $this->immeubles;
}
public function addImmeuble(Immeubles $immeuble): self
{
if (!$this->immeubles->contains($immeuble)) {
$this->immeubles[] = $immeuble;
$immeuble->setQuartier($this);
}
return $this;
}
public function removeImmeuble(Immeubles $immeuble): self
{
if ($this->immeubles->removeElement($immeuble)) {
// set the owning side to null (unless already changed)
if ($immeuble->getQuartier() === $this) {
$immeuble->setQuartier(null);
}
}
return $this;
}
}