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