src/Domain/Entity/MetadataExpediente.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use App\Shared\Domain\ApplicationCore\Interfaces\EntityInterface;
  4. use DateTime;
  5. use DateTimeInterface;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\DBAL\Types\Types;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\Uid\Uuid;
  11. class MetadataExpediente implements EntityInterface
  12. {
  13.     private ?string $key null;
  14.     private ?string $nombre null;
  15.     private ?string $descripcion null;
  16.     private ?DateTimeInterface $createdAt null;
  17.     private ?DateTimeInterface $updatedAt null;
  18.     private ?Uuid $id null;
  19.     private ?Entidad $entidad null;
  20.     private Collection $expedientes;
  21.     private Collection $metadataTramites ;
  22.     private Collection $responsables;
  23.     private ?EstadoExpediente $estadoInicial null;
  24.     private ?EstadoExpediente $estadoFinal null;
  25.     private Collection $estadoDisponibles;
  26.     private ?DateTimeInterface $deletedAt null;
  27.     private Collection $estados;
  28.     private ?MetadataExpedienteCabecera $metadataCabecera null;
  29.     private Collection $entidades;
  30.     public function __construct()
  31.     {
  32.         $this->metadataCabecera = new MetadataExpedienteCabecera();
  33.         $this->expedientes = new ArrayCollection();
  34.         $this->metadataTramites = new ArrayCollection();
  35.         $this->responsables = new ArrayCollection();
  36.         $this->estadoDisponibles = new ArrayCollection();
  37.         $this->estados = new ArrayCollection();
  38.         $this->entidades = new ArrayCollection();
  39.     }
  40.     public function __toString(): string
  41.     {
  42.         return $this->getNombre()??$this->getKey()??'';
  43.     }
  44.     public function getKey(): ?string
  45.     {
  46.         return $this->key;
  47.     }
  48.     public function setKey(string $key): static
  49.     {
  50.         $this->key $key;
  51.         return $this;
  52.     }
  53.     public function getCreatedAt(): ?DateTimeInterface
  54.     {
  55.         return $this->createdAt;
  56.     }
  57.     public function setCreatedAt(?DateTimeInterface $createdAt): static
  58.     {
  59.         $this->createdAt $createdAt;
  60.         return $this;
  61.     }
  62.     public function getUpdatedAt(): ?DateTimeInterface
  63.     {
  64.         return $this->updatedAt;
  65.     }
  66.     public function setUpdatedAt(?DateTimeInterface $updatedAt): static
  67.     {
  68.         $this->updatedAt $updatedAt;
  69.         return $this;
  70.     }
  71.     public function getId(): ?Uuid
  72.     {
  73.         return $this->id;
  74.     }
  75.     /**
  76.      * @return Collection<int, Expediente>
  77.      */
  78.     public function getExpedientes(): Collection
  79.     {
  80.         return $this->expedientes;
  81.     }
  82.     public function addExpediente(Expediente $expediente): static
  83.     {
  84.         if (!$this->expedientes->contains($expediente)) {
  85.             $this->expedientes->add($expediente);
  86.             $expediente->setMetadata($this);
  87.         }
  88.         return $this;
  89.     }
  90.     public function removeExpediente(Expediente $expediente): static
  91.     {
  92.         if ($this->expedientes->removeElement($expediente)) {
  93.             // set the owning side to null (unless already changed)
  94.             if ($expediente->getMetadata() === $this) {
  95.                 $expediente->setMetadata(null);
  96.             }
  97.         }
  98.         return $this;
  99.     }
  100.     /**
  101.      * @return Collection<int, MetadataTramite>
  102.      */
  103.     public function getMetadataTramites(): Collection
  104.     {
  105.         return $this->metadataTramites;
  106.     }
  107.     public function addMetadataTramite(MetadataTramite $metadataTramite): static
  108.     {
  109.         if (!$this->metadataTramites->contains($metadataTramite)) {
  110.             $this->metadataTramites->add($metadataTramite);
  111.             $metadataTramite->setMetadataExpediente($this);
  112.         }
  113.         return $this;
  114.     }
  115.     public function removeMetadataTramite(MetadataTramite $metadataTramite): static
  116.     {
  117.         if ($this->metadataTramites->removeElement($metadataTramite)) {
  118.             // set the owning side to null (unless already changed)
  119.             if ($metadataTramite->getMetadataExpediente() === $this) {
  120.                 $metadataTramite->setMetadataExpediente(null);
  121.             }
  122.         }
  123.         return $this;
  124.     }
  125.     public function getNombre(): ?string
  126.     {
  127.         return $this->nombre;
  128.     }
  129.     public function setNombre(?string $nombre): static
  130.     {
  131.         $this->nombre $nombre;
  132.         return $this;
  133.     }
  134.     public function getDescripcion(): ?string
  135.     {
  136.         return $this->descripcion;
  137.     }
  138.     public function setDescripcion(?string $descripcion): static
  139.     {
  140.         $this->descripcion $descripcion;
  141.         return $this;
  142.     }
  143.     /**
  144.      * @return Collection<int, SonataUserUser>
  145.      */
  146.     public function getResponsables(): Collection
  147.     {
  148.         return $this->responsables;
  149.     }
  150.     public function addResponsable(SonataUserUser $responsable): static
  151.     {
  152.         if (!$this->responsables->contains($responsable)) {
  153.             $this->responsables->add($responsable);
  154.         }
  155.         return $this;
  156.     }
  157.     public function removeResponsable(SonataUserUser $responsable): static
  158.     {
  159.         $this->responsables->removeElement($responsable);
  160.         return $this;
  161.     }
  162.     public function getEstadoInicial(): ?EstadoExpediente
  163.     {
  164.         return $this->estadoInicial;
  165.     }
  166.     public function setEstadoInicial(?EstadoExpediente $estadoInicial): static
  167.     {
  168.         $this->estadoInicial $estadoInicial;
  169.         return $this;
  170.     }
  171.     public function getEstadoFinal(): ?EstadoExpediente
  172.     {
  173.         return $this->estadoFinal;
  174.     }
  175.     public function setEstadoFinal(?EstadoExpediente $estadoFinal): static
  176.     {
  177.         $this->estadoFinal $estadoFinal;
  178.         return $this;
  179.     }
  180.     /**
  181.      * @return Collection<int, EstadoExpediente>
  182.      */
  183.     public function getEstadoDisponibles(): Collection
  184.     {
  185.         return $this->estadoDisponibles;
  186.     }
  187.     public function addEstadoDisponible(EstadoExpediente $estadoDisponible): static
  188.     {
  189.         if (!$this->estadoDisponibles->contains($estadoDisponible)) {
  190.             $this->estadoDisponibles->add($estadoDisponible);
  191.         }
  192.         return $this;
  193.     }
  194.     public function removeEstadoDisponible(EstadoExpediente $estadoDisponible): static
  195.     {
  196.         $this->estadoDisponibles->removeElement($estadoDisponible);
  197.         return $this;
  198.     }
  199.     public function getDeletedAt(): ?DateTimeInterface
  200.     {
  201.         return $this->deletedAt;
  202.     }
  203.     public function setDeletedAt(?DateTimeInterface $deletedAt): static
  204.     {
  205.         $this->deletedAt $deletedAt;
  206.         return $this;
  207.     }
  208.     /**
  209.      * @return Collection<int, Estado>
  210.      */
  211.     public function getEstados(): Collection
  212.     {
  213.         return $this->estados;
  214.     }
  215.     public function addEstado(Estado $estado): static
  216.     {
  217.         if (!$this->estados->contains($estado)) {
  218.             $this->estados->add($estado);
  219.         }
  220.         return $this;
  221.     }
  222.     public function removeEstado(Estado $estado): static
  223.     {
  224.         $this->estados->removeElement($estado);
  225.         return $this;
  226.     }
  227.     public function getEntidad(): ?Entidad
  228.     {
  229.         return $this->entidad;
  230.     }
  231.     public function setEntidad(?Entidad $entidad): static
  232.     {
  233.         $this->entidad $entidad;
  234.         return $this;
  235.     }
  236.     public function getMetadataCabecera(): ?MetadataExpedienteCabecera
  237.     {
  238.         return $this->metadataCabecera;
  239.     }
  240.     public function setMetadataCabecera(?MetadataExpedienteCabecera $metadataCabecera): static
  241.     {
  242.         $this->metadataCabecera $metadataCabecera;
  243.         return $this;
  244.     }
  245.     /**
  246.      * @return Collection<int, Entidad>
  247.      */
  248.     public function getEntidades(): Collection
  249.     {
  250.         return $this->entidades;
  251.     }
  252.     public function addEntidade(Entidad $entidade): static
  253.     {
  254.         if (!$this->entidades->contains($entidade)) {
  255.             $this->entidades->add($entidade);
  256.             $entidade->addMetadataExpedientesEnabled($this);
  257.         }
  258.         return $this;
  259.     }
  260.     public function removeEntidade(Entidad $entidade): static
  261.     {
  262.         if ($this->entidades->removeElement($entidade)) {
  263.             $entidade->removeMetadataExpedientesEnabled($this);
  264.         }
  265.         return $this;
  266.     }
  267. }