<?phpnamespace App\Domain\Entity;use App\Shared\Domain\ApplicationCore\Interfaces\EntityInterface;use DateTime;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 MetadataExpediente implements EntityInterface{ private ?string $key = null; private ?string $nombre = null; private ?string $descripcion = null; private ?DateTimeInterface $createdAt = null; private ?DateTimeInterface $updatedAt = null; private ?Uuid $id = null; private ?Entidad $entidad = null; private Collection $expedientes; private Collection $metadataTramites ; private Collection $responsables; private ?EstadoExpediente $estadoInicial = null; private ?EstadoExpediente $estadoFinal = null; private Collection $estadoDisponibles; private ?DateTimeInterface $deletedAt = null; private Collection $estados; private ?MetadataExpedienteCabecera $metadataCabecera = null; private Collection $entidades; public function __construct() { $this->metadataCabecera = new MetadataExpedienteCabecera(); $this->expedientes = new ArrayCollection(); $this->metadataTramites = new ArrayCollection(); $this->responsables = new ArrayCollection(); $this->estadoDisponibles = new ArrayCollection(); $this->estados = new ArrayCollection(); $this->entidades = new ArrayCollection(); } public function __toString(): string { return $this->getNombre()??$this->getKey()??''; } 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; } /** * @return Collection<int, Expediente> */ public function getExpedientes(): Collection { return $this->expedientes; } public function addExpediente(Expediente $expediente): static { if (!$this->expedientes->contains($expediente)) { $this->expedientes->add($expediente); $expediente->setMetadata($this); } return $this; } public function removeExpediente(Expediente $expediente): static { if ($this->expedientes->removeElement($expediente)) { // set the owning side to null (unless already changed) if ($expediente->getMetadata() === $this) { $expediente->setMetadata(null); } } return $this; } /** * @return Collection<int, MetadataTramite> */ public function getMetadataTramites(): Collection { return $this->metadataTramites; } public function addMetadataTramite(MetadataTramite $metadataTramite): static { if (!$this->metadataTramites->contains($metadataTramite)) { $this->metadataTramites->add($metadataTramite); $metadataTramite->setMetadataExpediente($this); } return $this; } public function removeMetadataTramite(MetadataTramite $metadataTramite): static { if ($this->metadataTramites->removeElement($metadataTramite)) { // set the owning side to null (unless already changed) if ($metadataTramite->getMetadataExpediente() === $this) { $metadataTramite->setMetadataExpediente(null); } } 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 getEstadoInicial(): ?EstadoExpediente { return $this->estadoInicial; } public function setEstadoInicial(?EstadoExpediente $estadoInicial): static { $this->estadoInicial = $estadoInicial; return $this; } public function getEstadoFinal(): ?EstadoExpediente { return $this->estadoFinal; } public function setEstadoFinal(?EstadoExpediente $estadoFinal): static { $this->estadoFinal = $estadoFinal; return $this; } /** * @return Collection<int, EstadoExpediente> */ public function getEstadoDisponibles(): Collection { return $this->estadoDisponibles; } public function addEstadoDisponible(EstadoExpediente $estadoDisponible): static { if (!$this->estadoDisponibles->contains($estadoDisponible)) { $this->estadoDisponibles->add($estadoDisponible); } return $this; } public function removeEstadoDisponible(EstadoExpediente $estadoDisponible): static { $this->estadoDisponibles->removeElement($estadoDisponible); return $this; } public function getDeletedAt(): ?DateTimeInterface { return $this->deletedAt; } public function setDeletedAt(?DateTimeInterface $deletedAt): static { $this->deletedAt = $deletedAt; return $this; } /** * @return Collection<int, Estado> */ public function getEstados(): Collection { return $this->estados; } public function addEstado(Estado $estado): static { if (!$this->estados->contains($estado)) { $this->estados->add($estado); } return $this; } public function removeEstado(Estado $estado): static { $this->estados->removeElement($estado); return $this; } public function getEntidad(): ?Entidad { return $this->entidad; } public function setEntidad(?Entidad $entidad): static { $this->entidad = $entidad; return $this; } public function getMetadataCabecera(): ?MetadataExpedienteCabecera { return $this->metadataCabecera; } public function setMetadataCabecera(?MetadataExpedienteCabecera $metadataCabecera): static { $this->metadataCabecera = $metadataCabecera; return $this; } /** * @return Collection<int, Entidad> */ public function getEntidades(): Collection { return $this->entidades; } public function addEntidade(Entidad $entidade): static { if (!$this->entidades->contains($entidade)) { $this->entidades->add($entidade); $entidade->addMetadataExpedientesEnabled($this); } return $this; } public function removeEntidade(Entidad $entidade): static { if ($this->entidades->removeElement($entidade)) { $entidade->removeMetadataExpedientesEnabled($this); } return $this; }}