src/Entity/Mantenimiento/PedidoReparacion.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Mantenimiento;
  3. use App\Repository\Mantenimiento\PedidoReparacionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use  App\Entity\User;
  9. use App\Entity\Equipos\Maquinaria;
  10. use App\Entity\Mantenimiento\Preventivo\TareaPlanDiagramada;
  11. use  App\Entity\RRHH\Empleado;
  12. use Symfony\Component\Validator\Constraints as Assert;
  13. /**
  14.  * @ORM\Entity(repositoryClass=PedidoReparacionRepository::class)
  15.  * @ORM\Table(name="mant_pedido_reparacion")
  16.  * @ORM\HasLifecycleCallbacks()
  17.  */
  18. class PedidoReparacion
  19. {
  20.     /**
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue
  23.      * @ORM\Column(type="integer")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @ORM\Column(name="fecha_carga", type="datetime")
  28.      */
  29.     private $fecha = null;
  30.     /**
  31.      * @ORM\Column(name="fecha_diagrama", type="datetime", nullable=true)
  32.      */
  33.     private $fechaDiagramacion;
  34.     /**
  35.      * @ORM\Column(type="text")
  36.      * @Assert\NotNull(message="El campo es requerido")
  37.      */
  38.     private $detalle;
  39.     /**
  40.      * @ORM\Column(type="boolean")
  41.      */
  42.     private $diagramada = false;
  43.     /**
  44.      * @ORM\Column(type="boolean")
  45.      */
  46.     private $realizada = false; 
  47.     /**
  48.      * @ORM\Column(type="boolean", options={"default": false})
  49.      */
  50.     private $eliminada = false; 
  51.     /**
  52.      * @ORM\OneToMany(targetEntity=PedidoReparacionDiagramado::class, mappedBy="pedido")
  53.      */
  54.     private $pedidosDiagramados;
  55.     /**
  56.      * @ORM\ManyToOne(targetEntity=SectorPlanta::class)
  57.      * @ORM\JoinColumn(name="id_sector", referencedColumnName="id", nullable=true)
  58.      * @Assert\NotNull(message="El campo es requerido")
  59.      */
  60.     private $sector;
  61.     /**
  62.      * @ORM\ManyToOne(targetEntity=TipoReparacion::class)
  63.      * @ORM\JoinColumn(name="id_tipo", referencedColumnName="id", nullable=true)
  64.      * @Assert\NotNull(message="El campo es requerido")
  65.      */
  66.     private $tipo;
  67.     /**
  68.      * @ORM\ManyToOne(targetEntity=Maquinaria::class)
  69.      * @ORM\JoinColumn(name="id_equipo", referencedColumnName="id", nullable=true)
  70.      */
  71.     private $equipo;
  72.     /**
  73.      * @ORM\ManyToOne(targetEntity=User::class) 
  74.      * @ORM\JoinColumn(name="id_user_alta", referencedColumnName="id", nullable=true)
  75.      */
  76.     private $usuarioAlta;
  77.     /**
  78.      * @ORM\ManyToOne(targetEntity=SolicitantePedidoReparacion::class) 
  79.      * @ORM\JoinColumn(name="id_solicitante", referencedColumnName="id", nullable=true)
  80.      */
  81.     private $solicitante;
  82.     /**
  83.      * @ORM\ManyToOne(targetEntity=TareaPlanDiagramada::class)
  84.      * @ORM\JoinColumn(name="id_tarea_plan", referencedColumnName="id", nullable=true)
  85.      */
  86.     private $tareaPlanDiagramada;
  87.     /**
  88.      * @ORM\ManyToOne(targetEntity=Departamento::class)
  89.      * @ORM\JoinColumn(name="id_depto", referencedColumnName="id", nullable=true)
  90.      * @Assert\NotNull(message="El campo es requerido")
  91.      */
  92.     private $departamento;
  93. /**
  94.      * @ORM\Column(type="string", length=255, nullable=true)
  95.      */
  96.     private $nombreArchivoImagen; // Nuevo campo
  97.     // ... (resto de campos y constructores)
  98.     /**
  99.      * @return string|null
  100.      */
  101.     public function getNombreArchivoImagen(): ?string
  102.     {
  103.         return $this->nombreArchivoImagen;
  104.     }
  105.     /**
  106.      * @param string|null $nombreArchivoImagen
  107.      * @return $this
  108.      */
  109.     public function setNombreArchivoImagen(?string $nombreArchivoImagen): self
  110.     {
  111.         $this->nombreArchivoImagen = $nombreArchivoImagen;
  112.         return $this;
  113.     }
  114.     public function __construct()
  115.     {
  116.         $this->pedidosDiagramados = new ArrayCollection();
  117.     }
  118.     /**
  119.      * @ORM\PrePersist
  120.      */
  121.     public function setCreatedAtValue()
  122.     {
  123.         if (!$this->fecha) 
  124.         {
  125.             $this->fecha = new \DateTimeImmutable();
  126.         }
  127.     }
  128.     public function getId(): ?int
  129.     {
  130.         return $this->id;
  131.     }
  132.     public function getFecha(): ?\DateTimeInterface
  133.     {
  134.         return $this->fecha;
  135.     }
  136.     public function setFecha(\DateTimeInterface $fecha): self
  137.     {
  138.         $this->fecha = $fecha;
  139.         return $this;
  140.     }
  141.     public function getFechaDiagramacion(): ?\DateTimeInterface
  142.     {
  143.         return $this->fechaDiagramacion;
  144.     }
  145.     public function setFechaDiagramacion(?\DateTimeInterface $fechaDiagramacion): self
  146.     {
  147.         $this->fechaDiagramacion = $fechaDiagramacion;
  148.         return $this;
  149.     }
  150.     public function getDetalle(): ?string
  151.     {
  152.         return $this->detalle;
  153.     }
  154.     public function setDetalle(string $detalle): self
  155.     {
  156.         $this->detalle = $detalle;
  157.         return $this;
  158.     }
  159.     public function isDiagramada(): ?bool
  160.     {
  161.         return $this->diagramada;
  162.     }
  163.     public function setDiagramada(bool $diagramada): self
  164.     {
  165.         $this->diagramada = $diagramada;
  166.         return $this;
  167.     }
  168.     public function isRealizada(): ?bool
  169.     {
  170.         return $this->realizada;
  171.     }
  172.     public function setRealizada(bool $realizada): self
  173.     {
  174.         $this->realizada = $realizada;
  175.         return $this;
  176.     }
  177.     public function getSector(): ?SectorPlanta
  178.     {
  179.         return $this->sector;
  180.     }
  181.     public function setSector(?SectorPlanta $sector): self
  182.     {
  183.         $this->sector = $sector;
  184.         return $this;
  185.     }
  186.     public function getEquipo(): ?Maquinaria
  187.     {
  188.         return $this->equipo;
  189.     }
  190.     public function setEquipo(?Maquinaria $equipo): self
  191.     {
  192.         $this->equipo = $equipo;
  193.         return $this;
  194.     }
  195.     public function getUsuarioAlta(): ?User
  196.     {
  197.         return $this->usuarioAlta;
  198.     }
  199.     public function setUsuarioAlta(?User $usuarioAlta): self
  200.     {
  201.         $this->usuarioAlta = $usuarioAlta;
  202.         return $this;
  203.     }
  204.     public function getTipo(): ?TipoReparacion
  205.     {
  206.         return $this->tipo;
  207.     }
  208.     public function setTipo(?TipoReparacion $tipo): self
  209.     {
  210.         $this->tipo = $tipo;
  211.         return $this;
  212.     }
  213.     public function getTareaPlanDiagramada(): ?TareaPlanDiagramada
  214.     {
  215.         return $this->tareaPlanDiagramada;
  216.     }
  217.     public function setTareaPlanDiagramada(?TareaPlanDiagramada $tareaPlanDiagramada): self
  218.     {
  219.         $this->tareaPlanDiagramada = $tareaPlanDiagramada;
  220.         return $this;
  221.     }
  222.     public function getDepartamento(): ?Departamento
  223.     {
  224.         return $this->departamento;
  225.     }
  226.     public function setDepartamento(?Departamento $departamento): self
  227.     {
  228.         $this->departamento = $departamento;
  229.         return $this;
  230.     }
  231.     /**
  232.      * @return Collection<int, PedidoReparacionDiagramado>
  233.      */
  234.     public function getPedidosDiagramados(): Collection
  235.     {
  236.         return $this->pedidosDiagramados;
  237.     }
  238.     public function addPedidosDiagramado(PedidoReparacionDiagramado $pedidosDiagramado): self
  239.     {
  240.         if (!$this->pedidosDiagramados->contains($pedidosDiagramado)) {
  241.             $this->pedidosDiagramados[] = $pedidosDiagramado;
  242.             $pedidosDiagramado->setPedido($this);
  243.         }
  244.         return $this;
  245.     }
  246.     public function removePedidosDiagramado(PedidoReparacionDiagramado $pedidosDiagramado): self
  247.     {
  248.         if ($this->pedidosDiagramados->removeElement($pedidosDiagramado)) {
  249.             // set the owning side to null (unless already changed)
  250.             if ($pedidosDiagramado->getPedido() === $this) {
  251.                 $pedidosDiagramado->setPedido(null);
  252.             }
  253.         }
  254.         return $this;
  255.     }
  256.     public function getSolicitante(): ?SolicitantePedidoReparacion
  257.     {
  258.         return $this->solicitante;
  259.     }
  260.     public function setSolicitante(?SolicitantePedidoReparacion $solicitante): self
  261.     {
  262.         $this->solicitante = $solicitante;
  263.         return $this;
  264.     }
  265.     public function isEliminada(): ?bool
  266.     {
  267.         return $this->eliminada;
  268.     }
  269.     public function setEliminada(bool $eliminada): self
  270.     {
  271.         $this->eliminada = $eliminada;
  272.         return $this;
  273.     }
  274.   
  275. }