<?php
namespace App\Entity;
use App\Repository\ParTipoDiligenciaRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ParTipoDiligenciaRepository::class)]
class ParTipoDiligencia {
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 100)]
private ?string $nombre = null;
#[ORM\ManyToOne(inversedBy: 'tipoDiligencia')]
private ?ParEstado $estado = null;
#[ORM\OneToMany(mappedBy: 'tipoDiligencia', targetEntity: RFDiligencia::class)]
private Collection $diligencia;
public function __construct() {
$this->diligencia = new ArrayCollection();
}
public function __toString() {
return $this->getNombre();
}
public function getId(): ?int {
return $this->id;
}
public function getNombre(): ?string {
return $this->nombre;
}
public function setNombre(string $nombre): static {
$this->nombre = $nombre;
return $this;
}
public function getEstado(): ?ParEstado {
return $this->estado;
}
public function setEstado(?ParEstado $estado): static {
$this->estado = $estado;
return $this;
}
/**
* @return Collection<int, RFDiligencia>
*/
public function getDiligencia(): Collection {
return $this->diligencia;
}
public function addDiligencium(RFDiligencia $diligencium): static {
if (!$this->diligencia->contains($diligencium)) {
$this->diligencia->add($diligencium);
$diligencium->setTipoDiligencia($this);
}
return $this;
}
public function removeDiligencium(RFDiligencia $diligencium): static {
if ($this->diligencia->removeElement($diligencium)) {
// set the owning side to null (unless already changed)
if ($diligencium->getTipoDiligencia() === $this) {
$diligencium->setTipoDiligencia(null);
}
}
return $this;
}
}