<?phpnamespace App\Domain\Entity;use App\Domain\Enum\EstadoTramiteEnum;use App\Domain\Interfaces\MetadataInterface;use App\Shared\Domain\ApplicationCore\Interfaces\EntityInterface;use DateTimeInterface;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Uid\Uuid;class Tramite implements EntityInterface, MetadataInterface{ private ?string $key = null; private ?string $nombre = null; private ?string $descripcion = null; private ?DateTimeInterface $createdAt = null; private ?DateTimeInterface $updatedAt = null; private $form = null; private ?Uuid $id = null; private ?string $translationDomain = null; private ?Expediente $expediente = null; private ?EstadoTramite $estadoTramite = null; private ?MetadataTramite $metadata = null; private Collection $responsables; private Collection $alarmas; private ?\DateTimeInterface $deletedAt = null; private $schema = null; private ?string $js = null; private ?string $css = null; private ?string $translations = null; public function __construct() { $this->responsables = new ArrayCollection(); $this->alarmas = new ArrayCollection(); } public function __toString(): string { $title = $this->getNombre()??$this->getKey()??''; 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>' .'</div><div id="tramite">'.$title .'</div><div id="fecha">'.$this->getUpdatedAt()?->format('d/m/Y') .'</div>'; } public function getMetadata(): ?MetadataTramite { return $this->metadata; } public function setMetadata(?MetadataInterface $metadata): static { $this->metadata = $metadata; return $this; } public function getKey(): ?string { return $this->key; } public function setKey(string $key): static { $this->key = $key; return $this; } public function getCreatedAt(): ?DateTimeInterface { return $this->createdAt; } public function setCreatedAt(DateTimeInterface $createdAt): static { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(DateTimeInterface $updatedAt): static { $this->updatedAt = $updatedAt; return $this; } public function getId(): ?Uuid { return $this->id; } public function getExpediente(): ?Expediente { return $this->expediente; } public function setExpediente(?Expediente $expediente): static { $this->expediente = $expediente; return $this; } public function getEstadoTramite(): ?EstadoTramite { return $this->estadoTramite; } public function setEstadoTramite(?EstadoTramite $estadoTramite): static { $this->estadoTramite = $estadoTramite; return $this; } public function getSchema(): ?string { return $this->schema?$this->schema:$this->getMetadata()?->getSchema(); } public function setSchema(?string $schema): static { $this->schema = $schema; return $this; } public function getForm(): ?string { return $this->form; } public function setForm(?string $form): static { $this->form = $form; return $this; } public function getNombre(): ?string { return $this->nombre; } public function setNombre(?string $nombre): static { $this->nombre = $nombre; return $this; } public function getDescripcion(): ?string { return $this->descripcion; } public function setDescripcion(?string $descripcion): static { $this->descripcion = $descripcion; return $this; } /** * @return Collection<int, SonataUserUser> */ public function getResponsables(): Collection { return $this->responsables; } public function addResponsable(SonataUserUser $responsable): static { if (!$this->responsables->contains($responsable)) { $this->responsables->add($responsable); } return $this; } public function removeResponsable(SonataUserUser $responsable): static { $this->responsables->removeElement($responsable); return $this; } public function getCss(): ?string { return $this->css; } public function setCss(?string $css): static { $this->css = $css; return $this; } public function getJs(): ?string { return $this->js; } public function setJs(?string $js): static { $this->js = $js; return $this; } public function getTranslations(): ?string { return $this->translations; } public function setTranslations(?string $translations): static { $this->translations = $translations; return $this; } public function getTranslationDomain(): ?string { return $this->translationDomain; } public function setTranslationDomain(?string $translationDomain): static { $this->translationDomain = $translationDomain; return $this; } /** * @return Collection<int, Alarma> */ public function getAlarmas(): Collection { return $this->alarmas; } public function addAlarma(Alarma $alarma): static { if (!$this->alarmas->contains($alarma)) { $this->alarmas->add($alarma); $alarma->setTramite($this); } return $this; } public function removeAlarma(Alarma $alarma): static { if ($this->alarmas->removeElement($alarma)) { // set the owning side to null (unless already changed) if ($alarma->getTramite() === $this) { $alarma->setTramite(null); } } return $this; } public function getDeletedAt(): ?\DateTimeInterface { return $this->deletedAt; } public function setDeletedAt(?\DateTimeInterface $deletedAt): static { $this->deletedAt = $deletedAt; return $this; }}