<?php
namespace App\Entity;
use App\Repository\ParTipoPerfilRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ParTipoPerfilRepository::class)]
class ParTipoPerfil
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 100)]
private ?string $perfil = null;
#[ORM\OneToMany(mappedBy: 'ParTipoPerfil', targetEntity: GHPerfilCargo::class)]
private Collection $idPerfilCargo;
public function __construct()
{
$this->idPerfilCargo = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getPerfil(): ?string
{
return $this->perfil;
}
public function setPerfil(string $perfil): static
{
$this->perfil = $perfil;
return $this;
}
public function __toString() {
return $this->getPerfil();
}
/**
* @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->setParTipoPerfil($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->getParTipoPerfil() === $this) {
$idPerfilCargo->setParTipoPerfil(null);
}
}
return $this;
}
}