<?php
namespace App\Entity;
use App\Repository\MantencionIncidenciaRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
#[ORM\Entity(repositoryClass: MantencionIncidenciaRepository::class)]
#[Vich\Uploadable]
class MantencionIncidencia
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;
#[ORM\Column(type: 'datetime')]
private ?\DateTimeInterface $fechaSolicitud = null;
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: false)]
private ?User $usuarioSolicitud = null;
#[ORM\ManyToOne(targetEntity: MantencionUrgencia::class)]
#[ORM\JoinColumn(nullable: false)]
private ?MantencionUrgencia $urgencia = null;
#[ORM\ManyToOne(targetEntity: MantencionTipoComunicacion::class)]
#[ORM\JoinColumn(nullable: false)]
private ?MantencionTipoComunicacion $tipoComunicacion = null;
#[ORM\ManyToOne(targetEntity: MantencionModulo::class)]
#[ORM\JoinColumn(nullable: false)]
private ?MantencionModulo $modulo = null;
#[ORM\ManyToOne(targetEntity: MantencionEstado::class)]
#[ORM\JoinColumn(nullable: false)]
private ?MantencionEstado $estado = null;
#[ORM\Column(type: 'text')]
private ?string $detalle = null;
#[ORM\Column(type: 'smallint', nullable: true)]
private ?int $horasEstimadas = null;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $esAutorizada = null;
#[ORM\ManyToOne(targetEntity: MantencionResponsable::class)]
private ?MantencionResponsable $responsable = null;
#[ORM\Column(type: 'smallint', nullable: true)]
private ?int $horasEjecucion = null;
#[ORM\ManyToOne(targetEntity: MantencionPeriodo::class)]
#[ORM\JoinColumn(nullable: false)]
private ?MantencionPeriodo $periodo = null;
#[ORM\OneToMany(mappedBy: 'incidencia', targetEntity: MantencionHistorial::class)]
private Collection $mantencionHistorials;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $esAprobada = null;
#[ORM\ManyToOne(targetEntity: MantencionClasificacion::class)]
private ?MantencionClasificacion $clasificacion = null;
#[ORM\Column(type: 'datetime', nullable: true)]
private ?\DateTimeInterface $fechaActualizacion = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $documento01Name = null;
#[Vich\UploadableField(mapping: 'soporte_tecnico_documentos', fileNameProperty: 'documento01Name')]
#[Assert\File(maxSize: '200Mi')]
private ?File $documento01File = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $documento02Name = null;
#[Vich\UploadableField(mapping: 'soporte_tecnico_documentos', fileNameProperty: 'documento02Name')]
#[Assert\File(maxSize: '200Mi')]
private ?File $documento02File = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $documento03Name = null;
#[Vich\UploadableField(mapping: 'soporte_tecnico_documentos', fileNameProperty: 'documento03Name')]
#[Assert\File(maxSize: '200Mi')]
private ?File $documento03File = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $documento04Name = null;
#[Vich\UploadableField(mapping: 'soporte_tecnico_documentos', fileNameProperty: 'documento04Name')]
#[Assert\File(maxSize: '200Mi')]
private ?File $documento04File = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $documento05Name = null;
#[Vich\UploadableField(mapping: 'soporte_tecnico_documentos', fileNameProperty: 'documento05Name')]
#[Assert\File(maxSize: '200Mi')]
private ?File $documento05File = null;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $respuesta = null;
#[ORM\Column(type: 'datetime', nullable: true)]
private ?\DateTimeInterface $fechaCierre = null;
public function __construct()
{
$this->mantencionHistorials = new ArrayCollection();
}
public function getId(): ?int { return $this->id; }
public function getFechaSolicitud(): ?\DateTimeInterface
{
return $this->fechaSolicitud;
}
public function setFechaSolicitud(?\DateTimeInterface $fechaSolicitud): self
{
$this->fechaSolicitud = $fechaSolicitud;
return $this;
}
public function getUsuarioSolicitud(): ?User
{
return $this->usuarioSolicitud;
}
public function setUsuarioSolicitud(?User $usuarioSolicitud): self
{
$this->usuarioSolicitud = $usuarioSolicitud;
return $this;
}
public function getUrgencia(): ?MantencionUrgencia
{
return $this->urgencia;
}
public function setUrgencia(?MantencionUrgencia $urgencia): self
{
$this->urgencia = $urgencia;
return $this;
}
public function getTipoComunicacion(): ?MantencionTipoComunicacion
{
return $this->tipoComunicacion;
}
public function setTipoComunicacion(?MantencionTipoComunicacion $tipoComunicacion): self
{
$this->tipoComunicacion = $tipoComunicacion;
return $this;
}
public function getModulo(): ?MantencionModulo
{
return $this->modulo;
}
public function setModulo(?MantencionModulo $modulo): self
{
$this->modulo = $modulo;
return $this;
}
public function getEstado(): ?MantencionEstado
{
return $this->estado;
}
public function setEstado(?MantencionEstado $estado): self
{
$this->estado = $estado;
return $this;
}
public function getDetalle(): ?string
{
return $this->detalle;
}
public function setDetalle(?string $detalle): self
{
$this->detalle = $detalle;
return $this;
}
public function getHorasEstimadas(): ?int
{
return $this->horasEstimadas;
}
public function setHorasEstimadas(?int $horasEstimadas): self
{
$this->horasEstimadas = $horasEstimadas;
return $this;
}
public function getEsAutorizada(): ?bool
{
return $this->esAutorizada;
}
public function setEsAutorizada(?bool $esAutorizada): self
{
$this->esAutorizada = $esAutorizada;
return $this;
}
public function getResponsable(): ?MantencionResponsable
{
return $this->responsable;
}
public function setResponsable(?MantencionResponsable $responsable): self
{
$this->responsable = $responsable;
return $this;
}
public function getHorasEjecucion(): ?int
{
return $this->horasEjecucion;
}
public function setHorasEjecucion(?int $horasEjecucion): self
{
$this->horasEjecucion = $horasEjecucion;
return $this;
}
public function getPeriodo(): ?MantencionPeriodo
{
return $this->periodo;
}
public function setPeriodo(?MantencionPeriodo $periodo): self
{
$this->periodo = $periodo;
return $this;
}
public function getMantencionHistorials(): Collection
{
return $this->mantencionHistorials;
}
public function addMantencionHistorial(MantencionHistorial $mantencionHistorial): self
{
if (!$this->mantencionHistorials->contains($mantencionHistorial)) {
$this->mantencionHistorials[] = $mantencionHistorial;
$mantencionHistorial->setIncidencia($this);
}
return $this;
}
public function removeMantencionHistorial(MantencionHistorial $mantencionHistorial): self
{
if ($this->mantencionHistorials->removeElement($mantencionHistorial)) {
if ($mantencionHistorial->getIncidencia() === $this) {
$mantencionHistorial->setIncidencia(null);
}
}
return $this;
}
public function getEsAprobada(): ?bool
{
return $this->esAprobada;
}
public function setEsAprobada(?bool $esAprobada): self
{
$this->esAprobada = $esAprobada;
return $this;
}
public function getClasificacion(): ?MantencionClasificacion
{
return $this->clasificacion;
}
public function setClasificacion(?MantencionClasificacion $clasificacion): self
{
$this->clasificacion = $clasificacion;
return $this;
}
public function getFechaActualizacion(): ?\DateTimeInterface
{
return $this->fechaActualizacion;
}
public function setFechaActualizacion(?\DateTimeInterface $fechaActualizacion): self
{
$this->fechaActualizacion = $fechaActualizacion;
return $this;
}
public function getDocumento01Name(): ?string
{
return $this->documento01Name;
}
public function setDocumento01Name(?string $documento01Name): self
{
$this->documento01Name = $documento01Name;
return $this;
}
public function getDocumento01File(): ?File
{
return $this->documento01File;
}
public function setDocumento01File(?File $documento01File): self
{
$this->documento01File = $documento01File;
if ($documento01File) {
$this->fechaActualizacion = new \DateTimeImmutable();
}
return $this;
}
public function getDocumento02Name(): ?string
{
return $this->documento02Name;
}
public function setDocumento02Name(?string $documento02Name): self
{
$this->documento02Name = $documento02Name;
return $this;
}
public function getDocumento02File(): ?File
{
return $this->documento02File;
}
public function setDocumento02File(?File $documento02File): self
{
$this->documento02File = $documento02File;
if ($documento02File) {
$this->fechaActualizacion = new \DateTimeImmutable();
}
return $this;
}
public function getDocumento03Name(): ?string
{
return $this->documento03Name;
}
public function setDocumento03Name(?string $documento03Name): self
{
$this->documento03Name = $documento03Name;
return $this;
}
public function getDocumento03File(): ?File
{
return $this->documento03File;
}
public function setDocumento03File(?File $documento03File): self
{
$this->documento03File = $documento03File;
if ($documento03File) {
$this->fechaActualizacion = new \DateTimeImmutable();
}
return $this;
}
public function getDocumento04Name(): ?string
{
return $this->documento04Name;
}
public function setDocumento04Name(?string $documento04Name): self
{
$this->documento04Name = $documento04Name;
return $this;
}
public function getDocumento04File(): ?File
{
return $this->documento04File;
}
public function setDocumento04File(?File $documento04File): self
{
$this->documento04File = $documento04File;
if ($documento04File) {
$this->fechaActualizacion = new \DateTimeImmutable();
}
return $this;
}
public function getDocumento05Name(): ?string
{
return $this->documento05Name;
}
public function setDocumento05Name(?string $documento05Name): self
{
$this->documento05Name = $documento05Name;
return $this;
}
public function getDocumento05File(): ?File
{
return $this->documento05File;
}
public function setDocumento05File(?File $documento05File): self
{
$this->documento05File = $documento05File;
if ($documento05File) {
$this->fechaActualizacion = new \DateTimeImmutable();
}
return $this;
}
public function getRespuesta(): ?string
{
return $this->respuesta;
}
public function setRespuesta(?string $respuesta): self
{
$this->respuesta = $respuesta;
return $this;
}
public function getFechaCierre(): ?\DateTimeInterface
{
return $this->fechaCierre;
}
public function setFechaCierre(?\DateTimeInterface $fechaCierre): self
{
$this->fechaCierre = $fechaCierre;
return $this;
}
}