src/Domain/Entity/Sede.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use App\Shared\Domain\ApplicationCore\Interfaces\EntityInterface;
  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. use Symfony\Component\Validator\Constraints as Assert;
  10. class Sede implements EntityInterface
  11. {
  12.     /**
  13.      * @var string|null
  14.      * @Assert\NotBlank(message="not_blank")
  15.      */
  16.     private ?string $abreviatura null;
  17.     /**
  18.      * @var string|null
  19.      * @Assert\NotBlank(message="not_blank")
  20.      */
  21.     private ?string $direccion null;
  22.     /**
  23.      * @var string|null
  24.      * @Assert\NotBlank(message="not_blank")
  25.      */
  26.     private ?string $cp null;
  27.     /**
  28.      * @var string|null
  29.      * @Assert\NotBlank(message="not_blank")
  30.      */
  31.     private ?string $telefono null;
  32.     /**
  33.      * @var string|null
  34.      * @Assert\NotBlank(message="not_blank")
  35.      */
  36.     private ?string $email null;
  37.     private ?\DateTimeInterface $createdAt null;
  38.     private ?\DateTimeInterface $updatedAt null;
  39.     private ?\DateTimeInterface $deletedAt null;
  40.     private ?Uuid $id null;
  41.     /**
  42.      * @var SonataUserUser|null
  43.      * @Assert\NotBlank(message="not_blank")
  44.      */
  45.     private ?SonataUserUser $responsable null;
  46.     private Collection $contadores;
  47.     /**
  48.      * @var Provincia|null
  49.      * @Assert\NotBlank(message="not_blank")
  50.      */
  51.     private ?Provincia $provincia null;
  52.     private ?Entidad $entidad null;
  53.     /**
  54.      * @var Municipio|null
  55.      * @Assert\NotBlank(message="not_blank")
  56.      */
  57.     private ?Municipio $municipio null;
  58.     private Collection $registros;
  59.     public function __construct()
  60.     {
  61.         $this->contadores = new ArrayCollection();
  62.         $this->registros = new ArrayCollection();
  63.     }
  64.     public function __toString(): string
  65.     {
  66.         return $this->getAbreviatura()??'---';
  67.     }
  68.     public function getAbreviatura(): ?string
  69.     {
  70.         return $this->abreviatura;
  71.     }
  72.     public function setAbreviatura(?string $abreviatura): static
  73.     {
  74.         $this->abreviatura $abreviatura;
  75.         return $this;
  76.     }
  77.     public function getDireccion(): ?string
  78.     {
  79.         return $this->direccion;
  80.     }
  81.     public function setDireccion(?string $direccion): static
  82.     {
  83.         $this->direccion $direccion;
  84.         return $this;
  85.     }
  86.     public function getCp(): ?string
  87.     {
  88.         return $this->cp;
  89.     }
  90.     public function setCp(?string $cp): static
  91.     {
  92.         $this->cp $cp;
  93.         return $this;
  94.     }
  95.     public function getTelefono(): ?string
  96.     {
  97.         return $this->telefono;
  98.     }
  99.     public function setTelefono(?string $telefono): static
  100.     {
  101.         $this->telefono $telefono;
  102.         return $this;
  103.     }
  104.     public function getEmail(): ?string
  105.     {
  106.         return $this->email;
  107.     }
  108.     public function setEmail(?string $email): static
  109.     {
  110.         $this->email $email;
  111.         return $this;
  112.     }
  113.     public function getCreatedAt(): ?\DateTimeInterface
  114.     {
  115.         return $this->createdAt;
  116.     }
  117.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  118.     {
  119.         $this->createdAt $createdAt;
  120.         return $this;
  121.     }
  122.     public function getUpdatedAt(): ?\DateTimeInterface
  123.     {
  124.         return $this->updatedAt;
  125.     }
  126.     public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  127.     {
  128.         $this->updatedAt $updatedAt;
  129.         return $this;
  130.     }
  131.     public function getDeletedAt(): ?\DateTimeInterface
  132.     {
  133.         return $this->deletedAt;
  134.     }
  135.     public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  136.     {
  137.         $this->deletedAt $deletedAt;
  138.         return $this;
  139.     }
  140.     public function getId(): ?Uuid
  141.     {
  142.         return $this->id;
  143.     }
  144.     /**
  145.      * @return Collection<int, Contador>
  146.      */
  147.     public function getContadores(): Collection
  148.     {
  149.         return $this->contadores;
  150.     }
  151.     public function addContadore(Contador $contadore): static
  152.     {
  153.         if (!$this->contadores->contains($contadore)) {
  154.             $this->contadores->add($contadore);
  155.             $contadore->setSede($this);
  156.         }
  157.         return $this;
  158.     }
  159.     public function removeContadore(Contador $contadore): static
  160.     {
  161.         if ($this->contadores->removeElement($contadore)) {
  162.             // set the owning side to null (unless already changed)
  163.             if ($contadore->getSede() === $this) {
  164.                 $contadore->setSede(null);
  165.             }
  166.         }
  167.         return $this;
  168.     }
  169.     public function getProvincia(): ?Provincia
  170.     {
  171.         return $this->provincia;
  172.     }
  173.     public function setProvincia(?Provincia $provincia): static
  174.     {
  175.         $this->provincia $provincia;
  176.         return $this;
  177.     }
  178.     public function getEntidad(): ?Entidad
  179.     {
  180.         return $this->entidad;
  181.     }
  182.     public function setEntidad(?Entidad $entidad): static
  183.     {
  184.         $this->entidad $entidad;
  185.         return $this;
  186.     }
  187.     public function getMunicipio(): ?Municipio
  188.     {
  189.         return $this->municipio;
  190.     }
  191.     public function setMunicipio(?Municipio $municipio): static
  192.     {
  193.         $this->municipio $municipio;
  194.         return $this;
  195.     }
  196.     public function getResponsable(): ?SonataUserUser
  197.     {
  198.         return $this->responsable;
  199.     }
  200.     public function setResponsable(?SonataUserUser $responsable): static
  201.     {
  202.         $this->responsable $responsable;
  203.         return $this;
  204.     }
  205.     /**
  206.      * @return Collection<int, DocumentacionRegistro>
  207.      */
  208.     public function getRegistros(): Collection
  209.     {
  210.         return $this->registros;
  211.     }
  212.     public function addRegistro(DocumentacionRegistro $registro): static
  213.     {
  214.         if (!$this->registros->contains($registro)) {
  215.             $this->registros->add($registro);
  216.             $registro->setSede($this);
  217.         }
  218.         return $this;
  219.     }
  220.     public function removeRegistro(DocumentacionRegistro $registro): static
  221.     {
  222.         if ($this->registros->removeElement($registro)) {
  223.             // set the owning side to null (unless already changed)
  224.             if ($registro->getSede() === $this) {
  225.                 $registro->setSede(null);
  226.             }
  227.         }
  228.         return $this;
  229.     }
  230. }