<?php
namespace App\Entity;
use App\Repository\ParTipoDocumentoRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ParTipoDocumentoRepository::class)]
class ParTipoDocumento
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\OneToMany(mappedBy: 'tipoDocumento', targetEntity: GHCandidato::class)]
private Collection $candidato;
#[ORM\Column(length: 100)]
private ?string $nombre = null;
#[ORM\OneToMany(mappedBy: 'tipoDocumento', targetEntity: TerPersona::class)]
private Collection $persona;
#[ORM\OneToMany(mappedBy: 'tipoDocumento', targetEntity: GHNovedadNomina::class)]
private Collection $novedadNomina;
#[ORM\OneToMany(mappedBy: 'tipoDocumento', targetEntity: SegVisitante::class)]
private Collection $visitante;
#[ORM\OneToMany(mappedBy: 'tipoId', targetEntity: ComProspecto::class)]
private Collection $comTipoDocumentos;
#[ORM\OneToMany(mappedBy: 'tipoId', targetEntity: TerEmpresaCliente::class)]
private Collection $terEmpresaClientes;
public function __construct()
{
$this->candidato = new ArrayCollection();
$this->persona = new ArrayCollection();
$this->novedadNomina = new ArrayCollection();
$this->visitante = new ArrayCollection();
$this->comTipoDocumentos = new ArrayCollection();
$this->terEmpresaClientes = new ArrayCollection();
}
public function __toString() {
return $this->getNombre();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return Collection<int, GHCandidato>
*/
public function getCandidato(): Collection
{
return $this->candidato;
}
public function addCandidato(GHCandidato $idCandidato): static
{
if (!$this->candidato->contains($idCandidato)) {
$this->candidato->add($idCandidato);
$idCandidato->setTipoDocumentoId($this);
}
return $this;
}
public function removeIdCandidato(GHCandidato $idCandidato): static
{
if ($this->candidato->removeElement($idCandidato)) {
// set the owning side to null (unless already changed)
if ($idCandidato->getTipoDocumentoId() === $this) {
$idCandidato->setTipoDocumentoId(null);
}
}
return $this;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(string $nombre): static
{
$this->nombre = $nombre;
return $this;
}
/**
* @return Collection<int, TerPersona>
*/
public function getPersona(): Collection
{
return $this->persona;
}
public function addPersona(TerPersona $persona): static
{
if (!$this->persona->contains($persona)) {
$this->persona->add($persona);
$persona->setTipoDocumento($this);
}
return $this;
}
public function removePersona(TerPersona $persona): static
{
if ($this->persona->removeElement($persona)) {
// set the owning side to null (unless already changed)
if ($persona->getTipoDocumento() === $this) {
$persona->setTipoDocumento(null);
}
}
return $this;
}
/**
* @return Collection<int, GHNovedadNomina>
*/
public function getNovedadNomina(): Collection
{
return $this->novedadNomina;
}
public function addNovedadNomina(GHNovedadNomina $novedadNomina): static
{
if (!$this->novedadNomina->contains($novedadNomina)) {
$this->novedadNomina->add($novedadNomina);
$novedadNomina->setTipoDocumento($this);
}
return $this;
}
public function removeNovedadNomina(GHNovedadNomina $novedadNomina): static
{
if ($this->novedadNomina->removeElement($novedadNomina)) {
// set the owning side to null (unless already changed)
if ($novedadNomina->getTipoDocumento() === $this) {
$novedadNomina->setTipoDocumento(null);
}
}
return $this;
}
/**
* @return Collection<int, SegVisitante>
*/
public function getVisitante(): Collection
{
return $this->visitante;
}
public function addVisitante(SegVisitante $visitante): static
{
if (!$this->visitante->contains($visitante)) {
$this->visitante->add($visitante);
$visitante->setTipoDocumento($this);
}
return $this;
}
public function removeVisitante(SegVisitante $visitante): static
{
if ($this->visitante->removeElement($visitante)) {
// set the owning side to null (unless already changed)
if ($visitante->getTipoDocumento() === $this) {
$visitante->setTipoDocumento(null);
}
}
return $this;
}
/**
* @return Collection<int, ComProspecto>
*/
public function getComTipoDocumentos(): Collection
{
return $this->comTipoDocumentos;
}
public function addComTipoDocumento(ComProspecto $comTipoDocumento): static
{
if (!$this->comTipoDocumentos->contains($comTipoDocumento)) {
$this->comTipoDocumentos->add($comTipoDocumento);
$comTipoDocumento->setTipoId($this);
}
return $this;
}
public function removeComTipoDocumento(ComProspecto $comTipoDocumento): static
{
if ($this->comTipoDocumentos->removeElement($comTipoDocumento)) {
// set the owning side to null (unless already changed)
if ($comTipoDocumento->getTipoId() === $this) {
$comTipoDocumento->setTipoId(null);
}
}
return $this;
}
/**
* @return Collection<int, TerEmpresaCliente>
*/
public function getTerEmpresaClientes(): Collection
{
return $this->terEmpresaClientes;
}
public function addTerEmpresaCliente(TerEmpresaCliente $terEmpresaCliente): static
{
if (!$this->terEmpresaClientes->contains($terEmpresaCliente)) {
$this->terEmpresaClientes->add($terEmpresaCliente);
$terEmpresaCliente->setTipoId($this);
}
return $this;
}
public function removeTerEmpresaCliente(TerEmpresaCliente $terEmpresaCliente): static
{
if ($this->terEmpresaClientes->removeElement($terEmpresaCliente)) {
// set the owning side to null (unless already changed)
if ($terEmpresaCliente->getTipoId() === $this) {
$terEmpresaCliente->setTipoId(null);
}
}
return $this;
}
}