<?phpnamespace App\Entity;use App\Repository\ParTipoVinculacionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ParTipoVinculacionRepository::class)]class ParTipoVinculacion { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 100)] private ?string $nombre = null; #[ORM\ManyToMany(targetEntity: GHPerfilCargo::class, mappedBy: 'vinculacion')] private Collection $perfilCargo; #[ORM\OneToMany(mappedBy: 'tipoVinculacion', targetEntity: GHVacante::class)] private Collection $vacante; public function __toString() { return $this->getNombre(); } public function __construct() { $this->perfilCargo = new ArrayCollection(); $this->vacante = new ArrayCollection(); } 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; } /** * @return Collection<int, GHPerfilCargo> */ public function getPerfilCargo(): Collection { return $this->perfilCargo; } public function addPerfilCargo(GHPerfilCargo $perfilCargo): static { if (!$this->perfilCargo->contains($perfilCargo)) { $this->perfilCargo->add($perfilCargo); $perfilCargo->addVinculacion($this); } return $this; } public function removePerfilCargo(GHPerfilCargo $perfilCargo): static { if ($this->perfilCargo->removeElement($perfilCargo)) { $perfilCargo->removeVinculacion($this); } return $this; } /** * @return Collection<int, GHVacante> */ public function getVacante(): Collection { return $this->vacante; } public function addVacante(GHVacante $vacante): static { if (!$this->vacante->contains($vacante)) { $this->vacante->add($vacante); $vacante->setTipoVinculacion($this); } return $this; } public function removeVacante(GHVacante $vacante): static { if ($this->vacante->removeElement($vacante)) { // set the owning side to null (unless already changed) if ($vacante->getTipoVinculacion() === $this) { $vacante->setTipoVinculacion(null); } } return $this; }}