src/Entity/ParTipoVinculacion.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParTipoVinculacionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParTipoVinculacionRepository::class)]
  8. class ParTipoVinculacion {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\Column(length100)]
  14.     private ?string $nombre null;
  15.     #[ORM\ManyToMany(targetEntityGHPerfilCargo::class, mappedBy'vinculacion')]
  16.     private Collection $perfilCargo;
  17.     #[ORM\OneToMany(mappedBy'tipoVinculacion'targetEntityGHVacante::class)]
  18.     private Collection $vacante;
  19.     public function __toString() {
  20.         return $this->getNombre();
  21.     }
  22.     public function __construct() {
  23.         $this->perfilCargo = new ArrayCollection();
  24.         $this->vacante = new ArrayCollection();
  25.     }
  26.     public function getId(): ?int {
  27.         return $this->id;
  28.     }
  29.     public function getNombre(): ?string {
  30.         return $this->nombre;
  31.     }
  32.     public function setNombre(string $nombre): static {
  33.         $this->nombre $nombre;
  34.         return $this;
  35.     }
  36.     /**
  37.      * @return Collection<int, GHPerfilCargo>
  38.      */
  39.     public function getPerfilCargo(): Collection {
  40.         return $this->perfilCargo;
  41.     }
  42.     public function addPerfilCargo(GHPerfilCargo $perfilCargo): static {
  43.         if (!$this->perfilCargo->contains($perfilCargo)) {
  44.             $this->perfilCargo->add($perfilCargo);
  45.             $perfilCargo->addVinculacion($this);
  46.         }
  47.         return $this;
  48.     }
  49.     public function removePerfilCargo(GHPerfilCargo $perfilCargo): static {
  50.         if ($this->perfilCargo->removeElement($perfilCargo)) {
  51.             $perfilCargo->removeVinculacion($this);
  52.         }
  53.         return $this;
  54.     }
  55.     /**
  56.      * @return Collection<int, GHVacante>
  57.      */
  58.     public function getVacante(): Collection
  59.     {
  60.         return $this->vacante;
  61.     }
  62.     public function addVacante(GHVacante $vacante): static
  63.     {
  64.         if (!$this->vacante->contains($vacante)) {
  65.             $this->vacante->add($vacante);
  66.             $vacante->setTipoVinculacion($this);
  67.         }
  68.         return $this;
  69.     }
  70.     public function removeVacante(GHVacante $vacante): static
  71.     {
  72.         if ($this->vacante->removeElement($vacante)) {
  73.             // set the owning side to null (unless already changed)
  74.             if ($vacante->getTipoVinculacion() === $this) {
  75.                 $vacante->setTipoVinculacion(null);
  76.             }
  77.         }
  78.         return $this;
  79.     }
  80. }