<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Vich\UploaderBundle\Mapping\Annotation\Uploadable;
use App\Enum\ParticipantesGrupoEstado;
/**
* @ORM\Entity
* @ORM\Table(
* name="participantes_grupo",
* indexes={
* @ORM\Index(name="idx_participantes_grupo_grupo", columns={"grupo_id"}),
* @ORM\Index(name="idx_participantes_etp", columns={"entidad_tiene_participantes_id"}),
* @ORM\Index(name="idx_participantes_deleted_at", columns={"deleted_at"})
* }
* )
*/
#[Uploadable]
class ParticipantesGrupo extends \App\Entity\BaseEntity
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=true, name="id_externo")
*/
private $idExterno;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
* @Gedmo\Timestampable(on="create")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2024-01-01 00:00:00"})
* @Gedmo\Timestampable(on="update")
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
*/
private $deletedAt;
/**
* @ORM\ManyToOne(targetEntity=\App\Entity\Grupo::class, inversedBy="participantesGrupos")
* @ORM\JoinColumn(name="grupo_id", referencedColumnName="id")
*/
private $grupo;
/**
* @ORM\Column(type="datetime", nullable=true, name="fecha_inscripcion")
*/
private $fechaInscripcion;
/**
* @ORM\Column(type="string", nullable=true)
*/
private ?string $estado = 'PREINSCRITO';
/**
* @ORM\Column(type="text", nullable=true)
*/
private ?string $motivoRechazo = null;
/**
* @ORM\Column(type="boolean", nullable=true, name="es_rechazo_definitivo")
*/
private ?bool $esRechazoDefinitivo = false;
/**
* @ORM\Column(type="string", length=255, nullable=true, name="motivo_baja")
*/
private ?string $motivoBaja = null;
/**
* @ORM\Column(type="text", nullable=true, name="detalles_motivo_baja")
*/
private ?string $detallesMotivoBaja = null;
public function getEstado(): ?string
{
return $this->estado;
}
public function setEstado(?string $estado): self
{
$this->estado = $estado;
return $this;
}
/**
* @ORM\Column(type="integer", nullable=true, name="id_formulario_respuesta")
*/
private $idFormularioRespuesta;
/**
* @ORM\Column(type="string", nullable=true, name="ruta_pdf_firmado")
*/
private $rutaPdfFirmado;
/**
* @ORM\Column(type="string", nullable=true, name="ruta_pdf_certificado")
*/
private $rutaPdfCertificado;
/**
* @var File|null
*/
#[Vich\UploadableField(mapping: 'participantes_grupo_pdf', fileNameProperty: 'rutaPdfFirmado')]
private $pdfFile;
/**
* @var File|null
*/
#[Vich\UploadableField(mapping: 'participantes_grupo_certificado_pdf', fileNameProperty: 'rutaPdfCertificado')]
private $pdfCertificadoFile;
/**
* Firma electrónica en formato XAdES-T codificada en base64
* @ORM\Column(type="text", nullable=true, name="firma_xml")
*/
private $firmaXml;
/**
* @ORM\OneToOne(targetEntity=\App\Entity\ParticipanteGrupoDetalle::class, inversedBy="participantesGrupos")
* @ORM\JoinColumn(name="entidad_tiene_participantes_id", referencedColumnName="id", unique=true)
*/
private $participanteGrupoDetalle;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\Cuestionario::class, mappedBy="participantesGrupo")
*/
private $cuestionarios;
public function __construct()
{
$this->cuestionarios = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function getIdExterno(): ?string
{
return $this->idExterno;
}
public function setIdExterno(?string $idExterno): static
{
$this->idExterno = $idExterno;
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 getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): static
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getGrupo(): ?Grupo
{
return $this->grupo;
}
public function setGrupo(?Grupo $grupo): static
{
$this->grupo = $grupo;
return $this;
}
public function getFechaInscripcion(): ?\DateTimeInterface
{
return $this->fechaInscripcion;
}
public function setFechaInscripcion(?\DateTimeInterface $fechaInscripcion): static
{
$this->fechaInscripcion = $fechaInscripcion;
return $this;
}
public function getIdFormularioRespuesta(): ?int
{
return $this->idFormularioRespuesta;
}
public function setIdFormularioRespuesta(?int $idFormularioRespuesta): static
{
$this->idFormularioRespuesta = $idFormularioRespuesta;
return $this;
}
public function getRutaPdfFirmado(): ?string
{
return $this->rutaPdfFirmado;
}
public function setRutaPdfFirmado(?string $rutaPdfFirmado): static
{
$this->rutaPdfFirmado = $rutaPdfFirmado;
return $this;
}
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $pdfFile
*/
public function setPdfFile(?File $pdfFile = null): void
{
$this->pdfFile = $pdfFile;
if (null !== $pdfFile) {
// Necesario para que Doctrine detecte el cambio si solo se ha cambiado el archivo
$this->updatedAt = new \DateTime();
}
}
public function getPdfFile(): ?File
{
return $this->pdfFile;
}
public function getRutaPdfCertificado(): ?string
{
return $this->rutaPdfCertificado;
}
public function setRutaPdfCertificado(?string $rutaPdfCertificado): static
{
$this->rutaPdfCertificado = $rutaPdfCertificado;
return $this;
}
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $pdfCertificadoFile
*/
public function setPdfCertificadoFile(?File $pdfCertificadoFile = null): void
{
$this->pdfCertificadoFile = $pdfCertificadoFile;
if (null !== $pdfCertificadoFile) {
// Necesario para que Doctrine detecte el cambio si solo se ha cambiado el archivo
$this->updatedAt = new \DateTime();
}
}
public function getPdfCertificadoFile(): ?File
{
return $this->pdfCertificadoFile;
}
public function getFirmaXml(): ?string
{
return $this->firmaXml;
}
public function setFirmaXml(?string $firmaXml): static
{
$this->firmaXml = $firmaXml;
return $this;
}
public function getParticipanteGrupoDetalle(): ?ParticipanteGrupoDetalle
{
return $this->participanteGrupoDetalle;
}
public function setParticipanteGrupoDetalle(?ParticipanteGrupoDetalle $participanteGrupoDetalle): static
{
$this->participanteGrupoDetalle = $participanteGrupoDetalle;
return $this;
}
public function getMotivoRechazo(): ?string
{
return $this->motivoRechazo;
}
public function setMotivoRechazo(?string $motivoRechazo): self
{
$this->motivoRechazo = $motivoRechazo;
return $this;
}
public function isEsRechazoDefinitivo(): ?bool
{
return $this->esRechazoDefinitivo;
}
public function setEsRechazoDefinitivo(?bool $esRechazoDefinitivo): self
{
$this->esRechazoDefinitivo = $esRechazoDefinitivo;
return $this;
}
/**
* @return Collection<int, Cuestionario>
*/
public function getCuestionarios(): Collection
{
return $this->cuestionarios;
}
public function addCuestionario(Cuestionario $cuestionario): static
{
if (!$this->cuestionarios->contains($cuestionario)) {
$this->cuestionarios->add($cuestionario);
$cuestionario->setParticipantesGrupo($this);
}
return $this;
}
public function removeCuestionario(Cuestionario $cuestionario): static
{
if ($this->cuestionarios->removeElement($cuestionario)) {
// set the owning side to null (unless already changed)
if ($cuestionario->getParticipantesGrupo() === $this) {
$cuestionario->setParticipantesGrupo(null);
}
}
return $this;
}
public function getMotivoBaja(): ?string
{
return $this->motivoBaja;
}
public function setMotivoBaja(?string $motivoBaja): self
{
$this->motivoBaja = $motivoBaja;
return $this;
}
public function getDetallesMotivoBaja(): ?string
{
return $this->detallesMotivoBaja;
}
public function setDetallesMotivoBaja(?string $detallesMotivoBaja): self
{
$this->detallesMotivoBaja = $detallesMotivoBaja;
return $this;
}
}