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