<?phpnamespace App\Entity;use App\Repository\ParMotivoJuridicoRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ParMotivoJuridicoRepository::class)]class ParMotivoJuridico{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $nombre = null; #[ORM\ManyToOne(inversedBy: 'motivoJuridico')] private ?ParProceso $proceso = null; #[ORM\ManyToOne(inversedBy: 'motivoJuridico')] private ?ParEstado $estado = null; #[ORM\ManyToMany(targetEntity: JurOperacionSospechosa::class, mappedBy: 'motivoJuridico')] private Collection $operacionSospechosa; public function __construct() { $this->operacionSospechosa = 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 getProceso(): ?ParProceso { return $this->proceso; } public function setProceso(?ParProceso $proceso): static { $this->proceso = $proceso; return $this; } public function getEstado(): ?ParEstado { return $this->estado; } public function setEstado(?ParEstado $estado): static { $this->estado = $estado; return $this; } /** * @return Collection<int, JurOperacionSospechosa> */ public function getOperacionSospechosa(): Collection { return $this->operacionSospechosa; } public function addOperacionSospechosa(JurOperacionSospechosa $operacionSospechosa): static { if (!$this->operacionSospechosa->contains($operacionSospechosa)) { $this->operacionSospechosa->add($operacionSospechosa); $operacionSospechosa->addMotivoJuridico($this); } return $this; } public function removeOperacionSospechosa(JurOperacionSospechosa $operacionSospechosa): static { if ($this->operacionSospechosa->removeElement($operacionSospechosa)) { $operacionSospechosa->removeMotivoJuridico($this); } return $this; }}