<?php
namespace App\Entity;
use App\Repository\ParCriticidadRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ParCriticidadRepository::class)]
class ParCriticidad
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $nombreCriticidad = null;
#[ORM\OneToMany(mappedBy: 'ParCriticidad', targetEntity: GHPerfilCargo::class)]
private Collection $idPerfilCargo;
public function __construct()
{
$this->idPerfilCargo = new ArrayCollection();
}
public function __toString() {
return $this->getNombreCriticidad();
}
public function getId(): ?int
{
return $this->id;
}
public function getNombreCriticidad(): ?string
{
return $this->nombreCriticidad;
}
public function setNombreCriticidad(string $nombreCriticidad): static
{
$this->nombreCriticidad = $nombreCriticidad;
return $this;
}
/**
* @return Collection<int, GHPerfilCargo>
*/
public function getIdPerfilCargo(): Collection
{
return $this->idPerfilCargo;
}
public function addIdPerfilCargo(GHPerfilCargo $idPerfilCargo): static
{
if (!$this->idPerfilCargo->contains($idPerfilCargo)) {
$this->idPerfilCargo->add($idPerfilCargo);
$idPerfilCargo->setParCriticidad($this);
}
return $this;
}
public function removeIdPerfilCargo(GHPerfilCargo $idPerfilCargo): static
{
if ($this->idPerfilCargo->removeElement($idPerfilCargo)) {
// set the owning side to null (unless already changed)
if ($idPerfilCargo->getParCriticidad() === $this) {
$idPerfilCargo->setParCriticidad(null);
}
}
return $this;
}
}