src/Domain/Entity/Municipio.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use DateTimeInterface;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Uid\Uuid;
  9. class Municipio
  10. {
  11.     private ?Uuid $id null;
  12.     private ?string $nombre null;
  13.     private ?string $nombreLocal null;
  14.     private ?string $cp null;
  15.     private ?array $geoPoint null;
  16.     private ?array $geoShape null;
  17.     private ?DateTimeInterface $createdAt null;
  18.     private ?DateTimeInterface $updatedAt null;
  19.     private ?DateTimeInterface $deletedAt null;
  20.     private Collection $empresas;
  21.     private Collection $localidades;
  22.     private Collection $sedes;
  23.     private Collection $consortiumLaborals;
  24.     private Collection $comisionesParitarias;
  25.     private ?Provincia $provincia null;
  26.     public function __construct()
  27.     {
  28.         $this->empresas = new ArrayCollection();
  29.         $this->localidades = new ArrayCollection();
  30.         $this->sedes = new ArrayCollection();
  31.         $this->consortiumLaborals = new ArrayCollection();
  32.         $this->comisionesParitarias = new ArrayCollection();
  33.     }
  34.     public function __toString(): string
  35.     {
  36.         return $this->getNombre()??'Municipio Sin Definir';
  37.     }
  38.     public function getNombre(): ?string
  39.     {
  40.         return $this->nombre;
  41.     }
  42.     public function setNombre(?string $nombre): static
  43.     {
  44.         $this->nombre $nombre;
  45.         return $this;
  46.     }
  47.     public function getNombreLocal(): ?string
  48.     {
  49.         return $this->nombreLocal;
  50.     }
  51.     public function setNombreLocal(?string $nombreLocal): static
  52.     {
  53.         $this->nombreLocal $nombreLocal;
  54.         return $this;
  55.     }
  56.     public function getCp(): ?string
  57.     {
  58.         return $this->cp;
  59.     }
  60.     public function setCp(?string $cp): static
  61.     {
  62.         $this->cp $cp;
  63.         return $this;
  64.     }
  65.     public function getGeoPoint(): ?array
  66.     {
  67.         return $this->geoPoint;
  68.     }
  69.     public function setGeoPoint(?array $geoPoint): static
  70.     {
  71.         $this->geoPoint $geoPoint;
  72.         return $this;
  73.     }
  74.     public function getGeoShape(): ?array
  75.     {
  76.         return $this->geoShape;
  77.     }
  78.     public function setGeoShape(?array $geoShape): static
  79.     {
  80.         $this->geoShape $geoShape;
  81.         return $this;
  82.     }
  83.     public function getCreatedAt(): ?\DateTimeInterface
  84.     {
  85.         return $this->createdAt;
  86.     }
  87.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  88.     {
  89.         $this->createdAt $createdAt;
  90.         return $this;
  91.     }
  92.     public function getUpdatedAt(): ?\DateTimeInterface
  93.     {
  94.         return $this->updatedAt;
  95.     }
  96.     public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  97.     {
  98.         $this->updatedAt $updatedAt;
  99.         return $this;
  100.     }
  101.     public function getDeletedAt(): ?\DateTimeInterface
  102.     {
  103.         return $this->deletedAt;
  104.     }
  105.     public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  106.     {
  107.         $this->deletedAt $deletedAt;
  108.         return $this;
  109.     }
  110.     public function getId(): ?Uuid
  111.     {
  112.         return $this->id;
  113.     }
  114.     /**
  115.      * @return Collection<int, Empresa>
  116.      */
  117.     public function getEmpresas(): Collection
  118.     {
  119.         return $this->empresas;
  120.     }
  121.     public function addEmpresa(Empresa $empresa): static
  122.     {
  123.         if (!$this->empresas->contains($empresa)) {
  124.             $this->empresas->add($empresa);
  125.             $empresa->setMunicipio($this);
  126.         }
  127.         return $this;
  128.     }
  129.     public function removeEmpresa(Empresa $empresa): static
  130.     {
  131.         if ($this->empresas->removeElement($empresa)) {
  132.             // set the owning side to null (unless already changed)
  133.             if ($empresa->getMunicipio() === $this) {
  134.                 $empresa->setMunicipio(null);
  135.             }
  136.         }
  137.         return $this;
  138.     }
  139.     /**
  140.      * @return Collection<int, Localidad>
  141.      */
  142.     public function getLocalidades(): Collection
  143.     {
  144.         return $this->localidades;
  145.     }
  146.     public function addLocalidade(Localidad $localidade): static
  147.     {
  148.         if (!$this->localidades->contains($localidade)) {
  149.             $this->localidades->add($localidade);
  150.             $localidade->setMunicipio($this);
  151.         }
  152.         return $this;
  153.     }
  154.     public function removeLocalidade(Localidad $localidade): static
  155.     {
  156.         if ($this->localidades->removeElement($localidade)) {
  157.             // set the owning side to null (unless already changed)
  158.             if ($localidade->getMunicipio() === $this) {
  159.                 $localidade->setMunicipio(null);
  160.             }
  161.         }
  162.         return $this;
  163.     }
  164.     /**
  165.      * @return Collection<int, Sede>
  166.      */
  167.     public function getSedes(): Collection
  168.     {
  169.         return $this->sedes;
  170.     }
  171.     public function addSede(Sede $sede): static
  172.     {
  173.         if (!$this->sedes->contains($sede)) {
  174.             $this->sedes->add($sede);
  175.             $sede->setMunicipio($this);
  176.         }
  177.         return $this;
  178.     }
  179.     public function removeSede(Sede $sede): static
  180.     {
  181.         if ($this->sedes->removeElement($sede)) {
  182.             // set the owning side to null (unless already changed)
  183.             if ($sede->getMunicipio() === $this) {
  184.                 $sede->setMunicipio(null);
  185.             }
  186.         }
  187.         return $this;
  188.     }
  189.     /**
  190.      * @return Collection<int, ConsortiumLaboral>
  191.      */
  192.     public function getConsortiumLaborals(): Collection
  193.     {
  194.         return $this->consortiumLaborals;
  195.     }
  196.     public function addConsortiumLaboral(ConsortiumLaboral $consortiumLaboral): static
  197.     {
  198.         if (!$this->consortiumLaborals->contains($consortiumLaboral)) {
  199.             $this->consortiumLaborals->add($consortiumLaboral);
  200.             $consortiumLaboral->setMunicipio($this);
  201.         }
  202.         return $this;
  203.     }
  204.     public function removeConsortiumLaboral(ConsortiumLaboral $consortiumLaboral): static
  205.     {
  206.         if ($this->consortiumLaborals->removeElement($consortiumLaboral)) {
  207.             // set the owning side to null (unless already changed)
  208.             if ($consortiumLaboral->getMunicipio() === $this) {
  209.                 $consortiumLaboral->setMunicipio(null);
  210.             }
  211.         }
  212.         return $this;
  213.     }
  214.     /**
  215.      * @return Collection<int, ComisionParitaria>
  216.      */
  217.     public function getComisionesParitarias(): Collection
  218.     {
  219.         return $this->comisionesParitarias;
  220.     }
  221.     public function addComisionesParitaria(ComisionParitaria $comisionesParitaria): static
  222.     {
  223.         if (!$this->comisionesParitarias->contains($comisionesParitaria)) {
  224.             $this->comisionesParitarias->add($comisionesParitaria);
  225.             $comisionesParitaria->setMunicipio($this);
  226.         }
  227.         return $this;
  228.     }
  229.     public function removeComisionesParitaria(ComisionParitaria $comisionesParitaria): static
  230.     {
  231.         if ($this->comisionesParitarias->removeElement($comisionesParitaria)) {
  232.             // set the owning side to null (unless already changed)
  233.             if ($comisionesParitaria->getMunicipio() === $this) {
  234.                 $comisionesParitaria->setMunicipio(null);
  235.             }
  236.         }
  237.         return $this;
  238.     }
  239.     public function getProvincia(): ?Provincia
  240.     {
  241.         return $this->provincia;
  242.     }
  243.     public function setProvincia(?Provincia $provincia): static
  244.     {
  245.         $this->provincia $provincia;
  246.         return $this;
  247.     }
  248. }