<?php
namespace App\Entity;
use App\Repository\ParDescripcionDiligenciaRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ParDescripcionDiligenciaRepository::class)]
class ParDescripcionDiligencia
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 150)]
private ?string $nombre = null;
#[ORM\ManyToOne(inversedBy: 'descripcionDiligencia')]
private ?ParEstado $estado = null;
#[ORM\OneToMany(mappedBy: 'descripcionDiligencia', targetEntity: RFDiligencia::class)]
private Collection $diligencias;
public function __construct()
{
$this->diligencia = new ArrayCollection();
$this->diligencias = 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 getDiligencias(): Collection
{
return $this->diligencias;
}
public function addDiligencia(RFDiligencia $diligencia): static
{
if (!$this->diligencias->contains($diligencia)) {
$this->diligencias->add($diligencia);
$diligencia->setDescripcionDiligencia($this);
}
return $this;
}
public function removeDiligencia(RFDiligencia $diligencia): static
{
if ($this->diligencias->removeElement($diligencia)) {
// set the owning side to null (unless already changed)
if ($diligencia->getDescripcionDiligencia() === $this) {
$diligencia->setDescripcionDiligencia(null);
}
}
return $this;
}
}