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\OneToMany(targetEntity=PedidoReparacionDiagramado::class, mappedBy="pedido")
  49.      */
  50.     private $pedidosDiagramados;
  51.     /**
  52.      * @ORM\ManyToOne(targetEntity=SectorPlanta::class)
  53.      * @ORM\JoinColumn(name="id_sector", referencedColumnName="id", nullable=true)
  54.      * @Assert\NotNull(message="El campo es requerido")
  55.      */
  56.     private $sector;
  57.     /**
  58.      * @ORM\ManyToOne(targetEntity=TipoReparacion::class)
  59.      * @ORM\JoinColumn(name="id_tipo", referencedColumnName="id", nullable=true)
  60.      * @Assert\NotNull(message="El campo es requerido")
  61.      */
  62.     private $tipo;
  63.     /**
  64.      * @ORM\ManyToOne(targetEntity=Maquinaria::class)
  65.      * @ORM\JoinColumn(name="id_equipo", referencedColumnName="id", nullable=true)
  66.      */
  67.     private $equipo;
  68.     /**
  69.      * @ORM\ManyToOne(targetEntity=User::class) 
  70.      * @ORM\JoinColumn(name="id_user_alta", referencedColumnName="id", nullable=true)
  71.      */
  72.     private $usuarioAlta;
  73.     /**
  74.      * @ORM\ManyToOne(targetEntity=SolicitantePedidoReparacion::class) 
  75.      * @ORM\JoinColumn(name="id_solicitante", referencedColumnName="id", nullable=true)
  76.      */
  77.     private $solicitante;
  78.     /**
  79.      * @ORM\ManyToOne(targetEntity=TareaPlanDiagramada::class)
  80.      * @ORM\JoinColumn(name="id_tarea_plan", referencedColumnName="id", nullable=true)
  81.      */
  82.     private $tareaPlanDiagramada;
  83.     /**
  84.      * @ORM\ManyToOne(targetEntity=Departamento::class)
  85.      * @ORM\JoinColumn(name="id_depto", referencedColumnName="id", nullable=true)
  86.      * @Assert\NotNull(message="El campo es requerido")
  87.      */
  88.     private $departamento;
  89. /**
  90.      * @ORM\Column(type="string", length=255, nullable=true)
  91.      */
  92.     private $nombreArchivoImagen// Nuevo campo
  93.     // ... (resto de campos y constructores)
  94.     /**
  95.      * @return string|null
  96.      */
  97.     public function getNombreArchivoImagen(): ?string
  98.     {
  99.         return $this->nombreArchivoImagen;
  100.     }
  101.     /**
  102.      * @param string|null $nombreArchivoImagen
  103.      * @return $this
  104.      */
  105.     public function setNombreArchivoImagen(?string $nombreArchivoImagen): self
  106.     {
  107.         $this->nombreArchivoImagen $nombreArchivoImagen;
  108.         return $this;
  109.     }
  110.     public function __construct()
  111.     {
  112.         $this->pedidosDiagramados = new ArrayCollection();
  113.     }
  114.     /**
  115.      * @ORM\PrePersist
  116.      */
  117.     public function setCreatedAtValue()
  118.     {
  119.         if (!$this->fecha
  120.         {
  121.             $this->fecha = new \DateTimeImmutable();
  122.         }
  123.     }
  124.     public function getId(): ?int
  125.     {
  126.         return $this->id;
  127.     }
  128.     public function getFecha(): ?\DateTimeInterface
  129.     {
  130.         return $this->fecha;
  131.     }
  132.     public function setFecha(\DateTimeInterface $fecha): self
  133.     {
  134.         $this->fecha $fecha;
  135.         return $this;
  136.     }
  137.     public function getFechaDiagramacion(): ?\DateTimeInterface
  138.     {
  139.         return $this->fechaDiagramacion;
  140.     }
  141.     public function setFechaDiagramacion(?\DateTimeInterface $fechaDiagramacion): self
  142.     {
  143.         $this->fechaDiagramacion $fechaDiagramacion;
  144.         return $this;
  145.     }
  146.     public function getDetalle(): ?string
  147.     {
  148.         return $this->detalle;
  149.     }
  150.     public function setDetalle(string $detalle): self
  151.     {
  152.         $this->detalle $detalle;
  153.         return $this;
  154.     }
  155.     public function isDiagramada(): ?bool
  156.     {
  157.         return $this->diagramada;
  158.     }
  159.     public function setDiagramada(bool $diagramada): self
  160.     {
  161.         $this->diagramada $diagramada;
  162.         return $this;
  163.     }
  164.     public function isRealizada(): ?bool
  165.     {
  166.         return $this->realizada;
  167.     }
  168.     public function setRealizada(bool $realizada): self
  169.     {
  170.         $this->realizada $realizada;
  171.         return $this;
  172.     }
  173.     public function getSector(): ?SectorPlanta
  174.     {
  175.         return $this->sector;
  176.     }
  177.     public function setSector(?SectorPlanta $sector): self
  178.     {
  179.         $this->sector $sector;
  180.         return $this;
  181.     }
  182.     public function getEquipo(): ?Maquinaria
  183.     {
  184.         return $this->equipo;
  185.     }
  186.     public function setEquipo(?Maquinaria $equipo): self
  187.     {
  188.         $this->equipo $equipo;
  189.         return $this;
  190.     }
  191.     public function getUsuarioAlta(): ?User
  192.     {
  193.         return $this->usuarioAlta;
  194.     }
  195.     public function setUsuarioAlta(?User $usuarioAlta): self
  196.     {
  197.         $this->usuarioAlta $usuarioAlta;
  198.         return $this;
  199.     }
  200.     public function getTipo(): ?TipoReparacion
  201.     {
  202.         return $this->tipo;
  203.     }
  204.     public function setTipo(?TipoReparacion $tipo): self
  205.     {
  206.         $this->tipo $tipo;
  207.         return $this;
  208.     }
  209.     public function getTareaPlanDiagramada(): ?TareaPlanDiagramada
  210.     {
  211.         return $this->tareaPlanDiagramada;
  212.     }
  213.     public function setTareaPlanDiagramada(?TareaPlanDiagramada $tareaPlanDiagramada): self
  214.     {
  215.         $this->tareaPlanDiagramada $tareaPlanDiagramada;
  216.         return $this;
  217.     }
  218.     public function getDepartamento(): ?Departamento
  219.     {
  220.         return $this->departamento;
  221.     }
  222.     public function setDepartamento(?Departamento $departamento): self
  223.     {
  224.         $this->departamento $departamento;
  225.         return $this;
  226.     }
  227.     /**
  228.      * @return Collection<int, PedidoReparacionDiagramado>
  229.      */
  230.     public function getPedidosDiagramados(): Collection
  231.     {
  232.         return $this->pedidosDiagramados;
  233.     }
  234.     public function addPedidosDiagramado(PedidoReparacionDiagramado $pedidosDiagramado): self
  235.     {
  236.         if (!$this->pedidosDiagramados->contains($pedidosDiagramado)) {
  237.             $this->pedidosDiagramados[] = $pedidosDiagramado;
  238.             $pedidosDiagramado->setPedido($this);
  239.         }
  240.         return $this;
  241.     }
  242.     public function removePedidosDiagramado(PedidoReparacionDiagramado $pedidosDiagramado): self
  243.     {
  244.         if ($this->pedidosDiagramados->removeElement($pedidosDiagramado)) {
  245.             // set the owning side to null (unless already changed)
  246.             if ($pedidosDiagramado->getPedido() === $this) {
  247.                 $pedidosDiagramado->setPedido(null);
  248.             }
  249.         }
  250.         return $this;
  251.     }
  252.     public function getSolicitante(): ?SolicitantePedidoReparacion
  253.     {
  254.         return $this->solicitante;
  255.     }
  256.     public function setSolicitante(?SolicitantePedidoReparacion $solicitante): self
  257.     {
  258.         $this->solicitante $solicitante;
  259.         return $this;
  260.     }
  261.   
  262. }