src/Entity/ParTipoConvocatoria.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParTipoConvocatoriaRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParTipoConvocatoriaRepository::class)]
  8. class ParTipoConvocatoria
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $tipoConvocatoria null;
  16.     #[ORM\ManyToMany(targetEntityGHVacante::class, mappedBy'ParTipoConvocatoria')]
  17.     private Collection $idVacante;
  18.     #[ORM\OneToMany(mappedBy'tipoConvocatoria'targetEntityGHCandidato::class)]
  19.     private Collection $candidato;
  20.     public function __construct()
  21.     {
  22.         $this->idVacante = new ArrayCollection();
  23.         $this->candidato = new ArrayCollection();
  24.     }
  25.     
  26.     public function __toString() {
  27.         return $this->getTipoConvocatoria();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getTipoConvocatoria(): ?string
  34.     {
  35.         return $this->tipoConvocatoria;
  36.     }
  37.     public function setTipoConvocatoria(string $tipoConvocatoria): static
  38.     {
  39.         $this->tipoConvocatoria $tipoConvocatoria;
  40.         return $this;
  41.     }
  42.     /**
  43.      * @return Collection<int, GHVacante>
  44.      */
  45.     public function getIdVacante(): Collection
  46.     {
  47.         return $this->idVacante;
  48.     }
  49.     public function addIdVacante(GHVacante $idVacante): static
  50.     {
  51.         if (!$this->idVacante->contains($idVacante)) {
  52.             $this->idVacante->add($idVacante);
  53.         }
  54.         return $this;
  55.     }
  56.     public function removeIdVacante(GHVacante $idVacante): static
  57.     {
  58.         $this->idVacante->removeElement($idVacante);
  59.         return $this;
  60.     }
  61.     /**
  62.      * @return Collection<int, GHCandidato>
  63.      */
  64.     public function getCandidato(): Collection
  65.     {
  66.         return $this->candidato;
  67.     }
  68.     public function addCandidato(GHCandidato $idCandidato): static
  69.     {
  70.         if (!$this->candidato->contains($idCandidato)) {
  71.             $this->candidato->add($idCandidato);
  72.             $idCandidato->setTipoConvocatoriaId($this);
  73.         }
  74.         return $this;
  75.     }
  76.     public function removeCandidato(GHCandidato $idCandidato): static
  77.     {
  78.         if ($this->candidato->removeElement($idCandidato)) {
  79.             // set the owning side to null (unless already changed)
  80.             if ($idCandidato->getTipoConvocatoriaId() === $this) {
  81.                 $idCandidato->setTipoConvocatoriaId(null);
  82.             }
  83.         }
  84.         return $this;
  85.     }
  86. }