src/Entity/ParTipoContrato.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParTipoContratoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParTipoContratoRepository::class)]
  8. class ParTipoContrato
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\OneToMany(mappedBy'ParTipoContrato'targetEntityGHVacante::class)]
  15.     private Collection $idVacante;
  16.     #[ORM\Column(length100)]
  17.     private ?string $nombre null;
  18.     #[ORM\OneToMany(mappedBy'tipoContrato'targetEntityGHCambioContrato::class)]
  19.     private Collection $cambioContrato;
  20.     #[ORM\ManyToMany(targetEntityGHPerfilCargo::class, mappedBy'tipoContrato')]
  21.     private Collection $perfilCargo;
  22.     #[ORM\OneToMany(mappedBy'tipoContrato'targetEntityTerPersona::class)]
  23.     private Collection $terPersonas;
  24.     public function __construct()
  25.     {
  26.         $this->idVacante = new ArrayCollection();
  27.         $this->cambioContrato = new ArrayCollection();
  28.         $this->perfilCargo = new ArrayCollection();
  29.         $this->terPersonas = new ArrayCollection();
  30.     }
  31.     
  32.     public function __toString() {
  33.         return $this->getNombre();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     /**
  40.      * @return Collection<int, GHVacante>
  41.      */
  42.     public function getIdVacante(): Collection
  43.     {
  44.         return $this->idVacante;
  45.     }
  46.     public function addIdVacante(GHVacante $idVacante): static
  47.     {
  48.         if (!$this->idVacante->contains($idVacante)) {
  49.             $this->idVacante->add($idVacante);
  50.             $idVacante->setParTipoContrato($this);
  51.         }
  52.         return $this;
  53.     }
  54.     public function removeIdVacante(GHVacante $idVacante): static
  55.     {
  56.         if ($this->idVacante->removeElement($idVacante)) {
  57.             // set the owning side to null (unless already changed)
  58.             if ($idVacante->getParTipoContrato() === $this) {
  59.                 $idVacante->setParTipoContrato(null);
  60.             }
  61.         }
  62.         return $this;
  63.     }
  64.     public function getNombre(): ?string
  65.     {
  66.         return $this->nombre;
  67.     }
  68.     public function setNombre(string $nombre): static
  69.     {
  70.         $this->nombre $nombre;
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection<int, GHCambioContrato>
  75.      */
  76.     public function getCambioContrato(): Collection
  77.     {
  78.         return $this->cambioContrato;
  79.     }
  80.     public function addCambioContrato(GHCambioContrato $cambioContrato): static
  81.     {
  82.         if (!$this->cambioContrato->contains($cambioContrato)) {
  83.             $this->cambioContrato->add($cambioContrato);
  84.             $cambioContrato->setTipoContrato($this);
  85.         }
  86.         return $this;
  87.     }
  88.     public function removeCambioContrato(GHCambioContrato $cambioContrato): static
  89.     {
  90.         if ($this->cambioContrato->removeElement($cambioContrato)) {
  91.             // set the owning side to null (unless already changed)
  92.             if ($cambioContrato->getTipoContrato() === $this) {
  93.                 $cambioContrato->setTipoContrato(null);
  94.             }
  95.         }
  96.         return $this;
  97.     }
  98.     /**
  99.      * @return Collection<int, GHPerfilCargo>
  100.      */
  101.     public function getPerfilCargo(): Collection
  102.     {
  103.         return $this->perfilCargo;
  104.     }
  105.     public function addPerfilCargo(GHPerfilCargo $perfilCargo): static
  106.     {
  107.         if (!$this->perfilCargo->contains($perfilCargo)) {
  108.             $this->perfilCargo->add($perfilCargo);
  109.             $perfilCargo->addTipoContrato($this);
  110.         }
  111.         return $this;
  112.     }
  113.     public function removePerfilCargo(GHPerfilCargo $perfilCargo): static
  114.     {
  115.         if ($this->perfilCargo->removeElement($perfilCargo)) {
  116.             $perfilCargo->removeTipoContrato($this);
  117.         }
  118.         return $this;
  119.     }
  120.     /**
  121.      * @return Collection<int, TerPersona>
  122.      */
  123.     public function getTerPersonas(): Collection
  124.     {
  125.         return $this->terPersonas;
  126.     }
  127.     public function addTerPersona(TerPersona $terPersona): static
  128.     {
  129.         if (!$this->terPersonas->contains($terPersona)) {
  130.             $this->terPersonas->add($terPersona);
  131.             $terPersona->setTipoContrato($this);
  132.         }
  133.         return $this;
  134.     }
  135.     public function removeTerPersona(TerPersona $terPersona): static
  136.     {
  137.         if ($this->terPersonas->removeElement($terPersona)) {
  138.             // set the owning side to null (unless already changed)
  139.             if ($terPersona->getTipoContrato() === $this) {
  140.                 $terPersona->setTipoContrato(null);
  141.             }
  142.         }
  143.         return $this;
  144.     }
  145. }