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