src/Domain/Entity/Ccaa.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 Ccaa
  10. {
  11.     private ?Uuid $id null;
  12.     private ?string $codigo null;
  13.     private ?string $nombre null;
  14.     private ?string $nombreLocal null;
  15.     private ?array $geoPoint null;
  16.     private ?array $geoShape null;
  17.     private ?string $pais null;
  18.     private ?DateTimeInterface $createdAt null;
  19.     private ?DateTimeInterface $updatedAt null;
  20.     private ?DateTimeInterface $deletedAt null;
  21.     private Collection $provincias;
  22.     private Collection $empresas;
  23.     public function __construct()
  24.     {
  25.         $this->provincias = new ArrayCollection();
  26.         $this->empresas = new ArrayCollection();
  27.     }
  28.     public function __toString(): string
  29.     {
  30.         return $this->getNombre()??'CCAA Sin Definir';
  31.     }
  32.     public function getCodigo(): ?string
  33.     {
  34.         return $this->codigo;
  35.     }
  36.     public function setCodigo(?string $codigo): static
  37.     {
  38.         $this->codigo $codigo;
  39.         return $this;
  40.     }
  41.     public function getNombre(): ?string
  42.     {
  43.         return $this->nombre;
  44.     }
  45.     public function setNombre(?string $nombre): static
  46.     {
  47.         $this->nombre $nombre;
  48.         return $this;
  49.     }
  50.     public function getNombreLocal(): ?string
  51.     {
  52.         return $this->nombreLocal;
  53.     }
  54.     public function setNombreLocal(?string $nombreLocal): static
  55.     {
  56.         $this->nombreLocal $nombreLocal;
  57.         return $this;
  58.     }
  59.     public function getGeoPoint(): ?array
  60.     {
  61.         return $this->geoPoint;
  62.     }
  63.     public function setGeoPoint(?array $geoPoint): static
  64.     {
  65.         $this->geoPoint $geoPoint;
  66.         return $this;
  67.     }
  68.     public function getGeoShape(): ?array
  69.     {
  70.         return $this->geoShape;
  71.     }
  72.     public function setGeoShape(?array $geoShape): static
  73.     {
  74.         $this->geoShape $geoShape;
  75.         return $this;
  76.     }
  77.     public function getPais(): ?string
  78.     {
  79.         return $this->pais;
  80.     }
  81.     public function setPais(?string $pais): static
  82.     {
  83.         $this->pais $pais;
  84.         return $this;
  85.     }
  86.     public function getCreatedAt(): ?\DateTimeInterface
  87.     {
  88.         return $this->createdAt;
  89.     }
  90.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  91.     {
  92.         $this->createdAt $createdAt;
  93.         return $this;
  94.     }
  95.     public function getUpdatedAt(): ?\DateTimeInterface
  96.     {
  97.         return $this->updatedAt;
  98.     }
  99.     public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  100.     {
  101.         $this->updatedAt $updatedAt;
  102.         return $this;
  103.     }
  104.     public function getDeletedAt(): ?\DateTimeInterface
  105.     {
  106.         return $this->deletedAt;
  107.     }
  108.     public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  109.     {
  110.         $this->deletedAt $deletedAt;
  111.         return $this;
  112.     }
  113.     public function getId(): ?Uuid
  114.     {
  115.         return $this->id;
  116.     }
  117.     /**
  118.      * @return Collection<int, Provincia>
  119.      */
  120.     public function getProvincias(): Collection
  121.     {
  122.         return $this->provincias;
  123.     }
  124.     public function addProvincia(Provincia $provincia): static
  125.     {
  126.         if (!$this->provincias->contains($provincia)) {
  127.             $this->provincias->add($provincia);
  128.             $provincia->setCcaa($this);
  129.         }
  130.         return $this;
  131.     }
  132.     public function removeProvincia(Provincia $provincia): static
  133.     {
  134.         if ($this->provincias->removeElement($provincia)) {
  135.             // set the owning side to null (unless already changed)
  136.             if ($provincia->getCcaa() === $this) {
  137.                 $provincia->setCcaa(null);
  138.             }
  139.         }
  140.         return $this;
  141.     }
  142.     /**
  143.      * @return Collection<int, Empresa>
  144.      */
  145.     public function getEmpresas(): Collection
  146.     {
  147.         return $this->empresas;
  148.     }
  149.     public function addEmpresa(Empresa $empresa): static
  150.     {
  151.         if (!$this->empresas->contains($empresa)) {
  152.             $this->empresas->add($empresa);
  153.             $empresa->setCcaa($this);
  154.         }
  155.         return $this;
  156.     }
  157.     public function removeEmpresa(Empresa $empresa): static
  158.     {
  159.         if ($this->empresas->removeElement($empresa)) {
  160.             // set the owning side to null (unless already changed)
  161.             if ($empresa->getCcaa() === $this) {
  162.                 $empresa->setCcaa(null);
  163.             }
  164.         }
  165.         return $this;
  166.     }
  167. }