<?phpnamespace App\Entity\Mantenimiento\Preventivo;use App\Repository\Mantenimiento\Preventivo\TareaPlanDiagramadaRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use App\Entity\Movimientos\MovimientoStock;/** * @ORM\Entity(repositoryClass=TareaPlanDiagramadaRepository::class) */class TareaPlanDiagramada { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="text", nullable=true) */ private $detalle; /** * @ORM\Column(type="boolean") */ private $realizada = true; /** * @ORM\ManyToOne(targetEntity=TareaPlan::class) * @ORM\JoinColumn(name="id_tarea", referencedColumnName="id") */ private $tareaPlan; /** * @ORM\ManyToOne(targetEntity=PlanMantenimientoDiagramado::class, inversedBy="tareasDiagramadas") * @ORM\JoinColumn(name="id_plan_diagramado", referencedColumnName="id") */ private $planMantenimientoDiagramado; /** * @ORM\OneToMany(targetEntity=MovimientoStock::class, mappedBy="tareaPreventivo") */ private $insumos; public function __construct() { $this->insumos = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getDetalle(): ?string { return $this->detalle; } public function setDetalle(?string $detalle): self { $this->detalle = $detalle; return $this; } public function isRealizada(): ?bool { return $this->realizada; } public function setRealizada(bool $realizada): self { $this->realizada = $realizada; return $this; } public function getTareaPlan(): ?TareaPlan { return $this->tareaPlan; } public function setTareaPlan(?TareaPlan $tareaPlan): self { $this->tareaPlan = $tareaPlan; return $this; } public function getPlanMantenimientoDiagramado(): ?PlanMantenimientoDiagramado { return $this->planMantenimientoDiagramado; } public function setPlanMantenimientoDiagramado(?PlanMantenimientoDiagramado $planMantenimientoDiagramado): self { $this->planMantenimientoDiagramado = $planMantenimientoDiagramado; return $this; } /** * @return Collection<int, MovimientoStock> */ public function getInsumos(): Collection { return $this->insumos; } public function addInsumo(MovimientoStock $insumo): self { if (!$this->insumos->contains($insumo)) { $this->insumos[] = $insumo; $insumo->setTareaPreventivo($this); } return $this; } public function removeInsumo(MovimientoStock $insumo): self { if ($this->insumos->removeElement($insumo)) { // set the owning side to null (unless already changed) if ($insumo->getTareaPreventivo() === $this) { $insumo->setTareaPreventivo(null); } } return $this; }}