src/Entity/Mantenimiento/Preventivo/TareaPlanDiagramada.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Mantenimiento\Preventivo;
  3. use App\Repository\Mantenimiento\Preventivo\TareaPlanDiagramadaRepository;
  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\Movimientos\MovimientoStock;
  9.   
  10. /**
  11.  * @ORM\Entity(repositoryClass=TareaPlanDiagramadaRepository::class)
  12.  */
  13. class TareaPlanDiagramada 
  14. {
  15.     /** 
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.  
  22.     /**
  23.      * @ORM\Column(type="text", nullable=true)
  24.      */
  25.     private $detalle;
  26.     /**
  27.      * @ORM\Column(type="boolean")
  28.      */
  29.     private $realizada true;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity=TareaPlan::class)
  32.      * @ORM\JoinColumn(name="id_tarea", referencedColumnName="id")
  33.      */
  34.     private $tareaPlan;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity=PlanMantenimientoDiagramado::class, inversedBy="tareasDiagramadas")
  37.      * @ORM\JoinColumn(name="id_plan_diagramado", referencedColumnName="id")
  38.      */
  39.     private $planMantenimientoDiagramado;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity=MovimientoStock::class, mappedBy="tareaPreventivo")
  42.      */
  43.     private $insumos;
  44.     public function __construct()
  45.     {
  46.         $this->insumos = new ArrayCollection();
  47.     }
  48.     public function getId(): ?int
  49.     {
  50.         return $this->id;
  51.     }
  52.     public function getDetalle(): ?string
  53.     {
  54.         return $this->detalle;
  55.     }
  56.     public function setDetalle(?string $detalle): self
  57.     {
  58.         $this->detalle $detalle;
  59.         return $this;
  60.     }
  61.     public function isRealizada(): ?bool
  62.     {
  63.         return $this->realizada;
  64.     }
  65.     public function setRealizada(bool $realizada): self
  66.     {
  67.         $this->realizada $realizada;
  68.         return $this;
  69.     }
  70.     public function getTareaPlan(): ?TareaPlan
  71.     {
  72.         return $this->tareaPlan;
  73.     }
  74.     public function setTareaPlan(?TareaPlan $tareaPlan): self
  75.     {
  76.         $this->tareaPlan $tareaPlan;
  77.         return $this;
  78.     }
  79.     public function getPlanMantenimientoDiagramado(): ?PlanMantenimientoDiagramado
  80.     {
  81.         return $this->planMantenimientoDiagramado;
  82.     }
  83.     public function setPlanMantenimientoDiagramado(?PlanMantenimientoDiagramado $planMantenimientoDiagramado): self
  84.     {
  85.         $this->planMantenimientoDiagramado $planMantenimientoDiagramado;
  86.         return $this;
  87.     }
  88.     /**
  89.      * @return Collection<int, MovimientoStock>
  90.      */
  91.     public function getInsumos(): Collection
  92.     {
  93.         return $this->insumos;
  94.     }
  95.     public function addInsumo(MovimientoStock $insumo): self
  96.     {
  97.         if (!$this->insumos->contains($insumo)) {
  98.             $this->insumos[] = $insumo;
  99.             $insumo->setTareaPreventivo($this);
  100.         }
  101.         return $this;
  102.     }
  103.     public function removeInsumo(MovimientoStock $insumo): self
  104.     {
  105.         if ($this->insumos->removeElement($insumo)) {
  106.             // set the owning side to null (unless already changed)
  107.             if ($insumo->getTareaPreventivo() === $this) {
  108.                 $insumo->setTareaPreventivo(null);
  109.             }
  110.         }
  111.         return $this;
  112.     }
  113. }