<?phpnamespace App\Entity;use App\Repository\ParTipoContratoRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ParTipoContratoRepository::class)]class ParTipoContrato{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\OneToMany(mappedBy: 'ParTipoContrato', targetEntity: GHVacante::class)] private Collection $idVacante; #[ORM\Column(length: 100)] private ?string $nombre = null; #[ORM\OneToMany(mappedBy: 'tipoContrato', targetEntity: GHCambioContrato::class)] private Collection $cambioContrato; #[ORM\ManyToMany(targetEntity: GHPerfilCargo::class, mappedBy: 'tipoContrato')] private Collection $perfilCargo; #[ORM\OneToMany(mappedBy: 'tipoContrato', targetEntity: TerPersona::class)] private Collection $terPersonas; public function __construct() { $this->idVacante = new ArrayCollection(); $this->cambioContrato = new ArrayCollection(); $this->perfilCargo = new ArrayCollection(); $this->terPersonas = new ArrayCollection(); } public function __toString() { return $this->getNombre(); } public function getId(): ?int { return $this->id; } /** * @return Collection<int, GHVacante> */ public function getIdVacante(): Collection { return $this->idVacante; } public function addIdVacante(GHVacante $idVacante): static { if (!$this->idVacante->contains($idVacante)) { $this->idVacante->add($idVacante); $idVacante->setParTipoContrato($this); } return $this; } public function removeIdVacante(GHVacante $idVacante): static { if ($this->idVacante->removeElement($idVacante)) { // set the owning side to null (unless already changed) if ($idVacante->getParTipoContrato() === $this) { $idVacante->setParTipoContrato(null); } } return $this; } public function getNombre(): ?string { return $this->nombre; } public function setNombre(string $nombre): static { $this->nombre = $nombre; return $this; } /** * @return Collection<int, GHCambioContrato> */ public function getCambioContrato(): Collection { return $this->cambioContrato; } public function addCambioContrato(GHCambioContrato $cambioContrato): static { if (!$this->cambioContrato->contains($cambioContrato)) { $this->cambioContrato->add($cambioContrato); $cambioContrato->setTipoContrato($this); } return $this; } public function removeCambioContrato(GHCambioContrato $cambioContrato): static { if ($this->cambioContrato->removeElement($cambioContrato)) { // set the owning side to null (unless already changed) if ($cambioContrato->getTipoContrato() === $this) { $cambioContrato->setTipoContrato(null); } } 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->addTipoContrato($this); } return $this; } public function removePerfilCargo(GHPerfilCargo $perfilCargo): static { if ($this->perfilCargo->removeElement($perfilCargo)) { $perfilCargo->removeTipoContrato($this); } return $this; } /** * @return Collection<int, TerPersona> */ public function getTerPersonas(): Collection { return $this->terPersonas; } public function addTerPersona(TerPersona $terPersona): static { if (!$this->terPersonas->contains($terPersona)) { $this->terPersonas->add($terPersona); $terPersona->setTipoContrato($this); } return $this; } public function removeTerPersona(TerPersona $terPersona): static { if ($this->terPersonas->removeElement($terPersona)) { // set the owning side to null (unless already changed) if ($terPersona->getTipoContrato() === $this) { $terPersona->setTipoContrato(null); } } return $this; }}