<?php
namespace App\Entity;
use App\Repository\ZonasPoblacionesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ZonasPoblacionesRepository::class)]
class ZonasPoblaciones
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 100)]
private ?string $nombre = null;
#[ORM\ManyToOne(inversedBy: 'zonasPoblaciones')]
#[ORM\JoinColumn(nullable: false)]
private ?Poblaciones $idpoblacion = null;
#[ORM\ManyToOne(inversedBy: 'zonasPoblaciones')]
#[ORM\JoinColumn(nullable: false)]
private ?CodigosPostales $idcodigopostal = null;
#[ORM\OneToMany(mappedBy: 'idzona', targetEntity: PropertyList::class)]
private Collection $propertyLists;
public function __construct()
{
$this->propertyLists = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(string $nombre): static
{
$this->nombre = $nombre;
return $this;
}
public function getIdpoblacion(): ?Poblaciones
{
return $this->idpoblacion;
}
public function setIdpoblacion(?Poblaciones $idpoblacion): static
{
$this->idpoblacion = $idpoblacion;
return $this;
}
public function getIdcodigopostal(): ?CodigosPostales
{
return $this->idcodigopostal;
}
public function setIdcodigopostal(?CodigosPostales $idcodigopostal): static
{
$this->idcodigopostal = $idcodigopostal;
return $this;
}
/**
* @return Collection<int, PropertyList>
*/
public function getPropertyLists(): Collection
{
return $this->propertyLists;
}
public function addPropertyList(PropertyList $propertyList): static
{
if (!$this->propertyLists->contains($propertyList)) {
$this->propertyLists->add($propertyList);
$propertyList->setIdzona($this);
}
return $this;
}
public function removePropertyList(PropertyList $propertyList): static
{
if ($this->propertyLists->removeElement($propertyList)) {
// set the owning side to null (unless already changed)
if ($propertyList->getIdzona() === $this) {
$propertyList->setIdzona(null);
}
}
return $this;
}
}