src/Domain/Entity/Tramite.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use App\Domain\Enum\EstadoTramiteEnum;
  4. use App\Domain\Interfaces\MetadataInterface;
  5. use App\Shared\Domain\ApplicationCore\Interfaces\EntityInterface;
  6. use DateTimeInterface;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\DBAL\Types\Types;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Symfony\Component\Uid\Uuid;
  12. class Tramite implements EntityInterfaceMetadataInterface
  13. {
  14.     private ?string $key null;
  15.     private ?string $nombre null;
  16.     private ?string $procedimiento null;
  17.     private ?string $descripcion null;
  18.     private ?DateTimeInterface $createdAt null;
  19.     private ?DateTimeInterface $updatedAt null;
  20.     private $form null;
  21.     private ?Uuid $id null;
  22.     private ?string $translationDomain null;
  23.     private ?Expediente $expediente null;
  24.     private ?EstadoTramite $estadoTramite null;
  25.     private ?MetadataTramite $metadata null;
  26.     private Collection $responsables;
  27.     private Collection $alarmas;
  28.     private ?\DateTimeInterface $deletedAt null;
  29.     private $schema null;
  30.     private ?string $js null;
  31.     private ?string $css null;
  32.     private ?string $translations null;
  33.     public function __construct()
  34.     {
  35.         $this->responsables = new ArrayCollection();
  36.         $this->alarmas = new ArrayCollection();
  37.     }
  38.     public function __toString(): string
  39.     {
  40.         $title $this->getNombre()??$this->getKey()??'';
  41.         return '<div id="estado">Estado <span style="background-color: '.$this->getEstadoTramite()?->getColor().'; border-radius: 50%; width: 20px; height: 20px; display: block;" title="'.EstadoTramiteEnum::getEstado($this->getEstadoTramite()?->getKey()).'"></span>'
  42.             .'</div><div id="tramite">Fase: '.$title
  43.             .'</div><div id="fecha">Fecha '.$this->getUpdatedAt()?->format('d/m/Y')
  44.             .'</div>';
  45.     }
  46.     public function getMetadata(): ?MetadataTramite
  47.     {
  48.         return $this->metadata;
  49.     }
  50.     public function setMetadata(?MetadataInterface $metadata): static
  51.     {
  52.         $this->metadata $metadata;
  53.         return $this;
  54.     }
  55.     public function getKey(): ?string
  56.     {
  57.         return $this->key;
  58.     }
  59.     public function setKey(string $key): static
  60.     {
  61.         $this->key $key;
  62.         return $this;
  63.     }
  64.     public function getCreatedAt(): ?DateTimeInterface
  65.     {
  66.         return $this->createdAt;
  67.     }
  68.     public function setCreatedAt(DateTimeInterface $createdAt): static
  69.     {
  70.         $this->createdAt $createdAt;
  71.         return $this;
  72.     }
  73.     public function getUpdatedAt(): ?DateTimeInterface
  74.     {
  75.         return $this->updatedAt;
  76.     }
  77.     public function setUpdatedAt(DateTimeInterface $updatedAt): static
  78.     {
  79.         $this->updatedAt $updatedAt;
  80.         return $this;
  81.     }
  82.     public function getId(): ?Uuid
  83.     {
  84.         return $this->id;
  85.     }
  86.     public function getExpediente(): ?Expediente
  87.     {
  88.         return $this->expediente;
  89.     }
  90.     public function setExpediente(?Expediente $expediente): static
  91.     {
  92.         $this->expediente $expediente;
  93.         return $this;
  94.     }
  95.     public function getEstado(): ?Estado
  96.     {
  97.         return $this->estadoTramite;
  98.     }
  99.     public function getEstadoTramite(): ?EstadoTramite
  100.     {
  101.         return $this->estadoTramite;
  102.     }
  103.     public function setEstadoTramite(?EstadoTramite $estadoTramite): static
  104.     {
  105.         $this->estadoTramite $estadoTramite;
  106.         return $this;
  107.     }
  108.     public function getSchema(): ?string
  109.     {
  110.         return $this->schema?$this->schema:$this->getMetadata()?->getSchema();
  111.     }
  112.     public function setSchema(?string $schema): static
  113.     {
  114.         $this->schema $schema;
  115.         return $this;
  116.     }
  117.     public function getForm(): ?string
  118.     {
  119.         return $this->form;
  120.     }
  121.     public function setForm(?string $form): static
  122.     {
  123.         $this->form $form;
  124.         return $this;
  125.     }
  126.     public function getNombre(): ?string
  127.     {
  128.         return $this->nombre;
  129.     }
  130.     public function setNombre(?string $nombre): static
  131.     {
  132.         $this->nombre $nombre;
  133.         return $this;
  134.     }
  135.     public function getDescripcion(): ?string
  136.     {
  137.         return $this->descripcion;
  138.     }
  139.     public function setDescripcion(?string $descripcion): static
  140.     {
  141.         $this->descripcion $descripcion;
  142.         return $this;
  143.     }
  144.     /**
  145.      * @return Collection<int, SonataUserUser>
  146.      */
  147.     public function getResponsables(): Collection
  148.     {
  149.         return $this->responsables;
  150.     }
  151.     public function addResponsable(SonataUserUser $responsable): static
  152.     {
  153.         if (!$this->responsables->contains($responsable)) {
  154.             $this->responsables->add($responsable);
  155.         }
  156.         return $this;
  157.     }
  158.     public function removeResponsable(SonataUserUser $responsable): static
  159.     {
  160.         $this->responsables->removeElement($responsable);
  161.         return $this;
  162.     }
  163.     public function getCss(): ?string
  164.     {
  165.         return $this->css;
  166.     }
  167.     public function setCss(?string $css): static
  168.     {
  169.         $this->css $css;
  170.         return $this;
  171.     }
  172.     public function getJs(): ?string
  173.     {
  174.         return $this->js;
  175.     }
  176.     public function setJs(?string $js): static
  177.     {
  178.         $this->js $js;
  179.         return $this;
  180.     }
  181.     public function getTranslations(): ?string
  182.     {
  183.         return $this->translations;
  184.     }
  185.     public function setTranslations(?string $translations): static
  186.     {
  187.         $this->translations $translations;
  188.         return $this;
  189.     }
  190.     public function getTranslationDomain(): ?string
  191.     {
  192.         return $this->translationDomain;
  193.     }
  194.     public function setTranslationDomain(?string $translationDomain): static
  195.     {
  196.         $this->translationDomain $translationDomain;
  197.         return $this;
  198.     }
  199.     /**
  200.      * @return Collection<int, Alarma>
  201.      */
  202.     public function getAlarmas(): Collection
  203.     {
  204.         return $this->alarmas;
  205.     }
  206.     public function addAlarma(Alarma $alarma): static
  207.     {
  208.         if (!$this->alarmas->contains($alarma)) {
  209.             $this->alarmas->add($alarma);
  210.             $alarma->setTramite($this);
  211.         }
  212.         return $this;
  213.     }
  214.     public function removeAlarma(Alarma $alarma): static
  215.     {
  216.         if ($this->alarmas->removeElement($alarma)) {
  217.             // set the owning side to null (unless already changed)
  218.             if ($alarma->getTramite() === $this) {
  219.                 $alarma->setTramite(null);
  220.             }
  221.         }
  222.         return $this;
  223.     }
  224.     public function getDeletedAt(): ?\DateTimeInterface
  225.     {
  226.         return $this->deletedAt;
  227.     }
  228.     public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  229.     {
  230.         $this->deletedAt $deletedAt;
  231.         return $this;
  232.     }
  233.     public function getProcedimiento(): ?string
  234.     {
  235.         return $this->procedimiento;
  236.     }
  237.     public function setProcedimiento(?string $procedimiento): static
  238.     {
  239.         $this->procedimiento $procedimiento;
  240.         return $this;
  241.     }
  242. }