src/Entity/ParTipoSeleccion.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParTipoSeleccionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParTipoSeleccionRepository::class)]
  8. class ParTipoSeleccion
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\OneToMany(mappedBy'ParTipoSeleccion'targetEntityGHVacante::class)]
  15.     private Collection $idVacante;
  16.     #[ORM\Column(length100)]
  17.     private ?string $nombre null;
  18.     public function __construct()
  19.     {
  20.         $this->idVacante = new ArrayCollection();
  21.     }
  22.     
  23.     public function __toString() {
  24.         return $this->getNombre();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     /**
  31.      * @return Collection<int, GHVacante>
  32.      */
  33.     public function getIdVacante(): Collection
  34.     {
  35.         return $this->idVacante;
  36.     }
  37.     public function addIdVacante(GHVacante $idVacante): static
  38.     {
  39.         if (!$this->idVacante->contains($idVacante)) {
  40.             $this->idVacante->add($idVacante);
  41.             $idVacante->setParTipoSeleccion($this);
  42.         }
  43.         return $this;
  44.     }
  45.     public function removeIdVacante(GHVacante $idVacante): static
  46.     {
  47.         if ($this->idVacante->removeElement($idVacante)) {
  48.             // set the owning side to null (unless already changed)
  49.             if ($idVacante->getParTipoSeleccion() === $this) {
  50.                 $idVacante->setParTipoSeleccion(null);
  51.             }
  52.         }
  53.         return $this;
  54.     }
  55.     public function getNombre(): ?string
  56.     {
  57.         return $this->nombre;
  58.     }
  59.     public function setNombre(string $nombre): static
  60.     {
  61.         $this->nombre $nombre;
  62.         return $this;
  63.     }
  64. }