src/Entity/ParCargo.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParCargoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParCargoRepository::class)]
  8. class ParCargo
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\OneToMany(mappedBy'cargo'targetEntityGHPerfilCargo::class)]
  15.     private Collection $perfilCargo;
  16.     #[ORM\Column(length100)]
  17.     private ?string $nombre null;
  18.     #[ORM\ManyToMany(targetEntityGHPerfilCargo::class, mappedBy'personalCargo')]
  19.     private Collection $perfilPersonalCargo;
  20.     #[ORM\OneToMany(mappedBy'cargo'targetEntityGHNovedadNomina::class)]
  21.     private Collection $novedadNomina;
  22.     #[ORM\ManyToMany(targetEntityParProceso::class, mappedBy'cargos')]
  23.     private Collection $procesos;
  24.     #[ORM\OneToMany(mappedBy'jefeInmediatoCargo'targetEntityGHPerfilCargo::class)]
  25.     private Collection $perfilCargoJefeInmediato;
  26.     #[ORM\OneToMany(mappedBy'cargoAprueba'targetEntityGHPerfilCargo::class)]
  27.     private Collection $perfilCargoAprueba;
  28.     public function __construct()
  29.     {
  30.         $this->perfilCargo = new ArrayCollection();
  31.         $this->perfilPersonalCargo = new ArrayCollection();
  32.         $this->novedadNomina = new ArrayCollection();
  33.         $this->procesos = new ArrayCollection();
  34.         $this->perfilCargoJefeInmediato = new ArrayCollection();
  35.         $this->perfilCargoAprueba = new ArrayCollection();
  36.     }
  37.     
  38.     public function __toString() {
  39.         return $this->getNombre();
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     /**
  46.      * @return Collection<int, GHPerfilCargo>
  47.      */
  48.     public function getPerfilCargo(): Collection
  49.     {
  50.         return $this->perfilCargo;
  51.     }
  52.     public function addPerfilCargo(GHPerfilCargo $perfilCargo): static
  53.     {
  54.         if (!$this->perfilCargo->contains($perfilCargo)) {
  55.             $this->perfilCargo->add($perfilCargo);
  56.             $perfilCargo->setCargo($this);
  57.         }
  58.         return $this;
  59.     }
  60.     public function removePerfilCargo(GHPerfilCargo $perfilCargo): static
  61.     {
  62.         if ($this->perfilCargo->removeElement($perfilCargo)) {
  63.             // set the owning side to null (unless already changed)
  64.             if ($perfilCargo->getCargo() === $this) {
  65.                 $perfilCargo->setCargo(null);
  66.             }
  67.         }
  68.         return $this;
  69.     }
  70.     public function getNombre(): ?string
  71.     {
  72.         return $this->nombre;
  73.     }
  74.     public function setNombre(string $nombre): static
  75.     {
  76.         $this->nombre $nombre;
  77.         return $this;
  78.     }
  79.     /**
  80.      * @return Collection<int, GHPerfilCargo>
  81.      */
  82.     public function getPerfilPersonalCargo(): Collection
  83.     {
  84.         return $this->perfilPersonalCargo;
  85.     }
  86.     public function addPerfilPersonalCargo(GHPerfilCargo $perfilPersonalCargo): static
  87.     {
  88.         if (!$this->perfilPersonalCargo->contains($perfilPersonalCargo)) {
  89.             $this->perfilPersonalCargo->add($perfilPersonalCargo);
  90.             $perfilPersonalCargo->addPersonalCargo($this);
  91.         }
  92.         return $this;
  93.     }
  94.     public function removePerfilPersonalCargo(GHPerfilCargo $perfilPersonalCargo): static
  95.     {
  96.         if ($this->perfilPersonalCargo->removeElement($perfilPersonalCargo)) {
  97.             $perfilPersonalCargo->removePersonalCargo($this);
  98.         }
  99.         return $this;
  100.     }
  101.     /**
  102.      * @return Collection<int, GHNovedadNomina>
  103.      */
  104.     public function getNovedadNomina(): Collection
  105.     {
  106.         return $this->novedadNomina;
  107.     }
  108.     public function addNovedadNomina(GHNovedadNomina $novedadNomina): static
  109.     {
  110.         if (!$this->novedadNomina->contains($novedadNomina)) {
  111.             $this->novedadNomina->add($novedadNomina);
  112.             $novedadNomina->setCargo($this);
  113.         }
  114.         return $this;
  115.     }
  116.     public function removeNovedadNomina(GHNovedadNomina $novedadNomina): static
  117.     {
  118.         if ($this->novedadNomina->removeElement($novedadNomina)) {
  119.             // set the owning side to null (unless already changed)
  120.             if ($novedadNomina->getCargo() === $this) {
  121.                 $novedadNomina->setCargo(null);
  122.             }
  123.         }
  124.         return $this;
  125.     }
  126.     /**
  127.      * @return Collection<int, ParProceso>
  128.      */
  129.     public function getProcesos(): Collection
  130.     {
  131.         return $this->procesos;
  132.     }
  133.     public function addProceso(ParProceso $proceso): static
  134.     {
  135.         if (!$this->procesos->contains($proceso)) {
  136.             $this->procesos->add($proceso);
  137.             $proceso->addCargo($this);
  138.         }
  139.         return $this;
  140.     }
  141.     public function removeProceso(ParProceso $proceso): static
  142.     {
  143.         if ($this->procesos->removeElement($proceso)) {
  144.             $proceso->removeCargo($this);
  145.         }
  146.         return $this;
  147.     }
  148.     /**
  149.      * @return Collection<int, GHPerfilCargo>
  150.      */
  151.     public function getPerfilCargoJefeInmediato(): Collection
  152.     {
  153.         return $this->perfilCargoJefeInmediato;
  154.     }
  155.     public function addPerfilCargoJefeInmediato(GHPerfilCargo $perfilCargoJefeInmediato): static
  156.     {
  157.         if (!$this->perfilCargoJefeInmediato->contains($perfilCargoJefeInmediato)) {
  158.             $this->perfilCargoJefeInmediato->add($perfilCargoJefeInmediato);
  159.             $perfilCargoJefeInmediato->setJefeInmediatoCargo($this);
  160.         }
  161.         return $this;
  162.     }
  163.     public function removePerfilCargoJefeInmediato(GHPerfilCargo $perfilCargoJefeInmediato): static
  164.     {
  165.         if ($this->perfilCargoJefeInmediato->removeElement($perfilCargoJefeInmediato)) {
  166.             // set the owning side to null (unless already changed)
  167.             if ($perfilCargoJefeInmediato->getJefeInmediatoCargo() === $this) {
  168.                 $perfilCargoJefeInmediato->setJefeInmediatoCargo(null);
  169.             }
  170.         }
  171.         return $this;
  172.     }
  173.     /**
  174.      * @return Collection<int, GHPerfilCargo>
  175.      */
  176.     public function getPerfilCargoAprueba(): Collection
  177.     {
  178.         return $this->perfilCargoAprueba;
  179.     }
  180.     public function addPerfilCargoAprueba(GHPerfilCargo $perfilCargoAprueba): static
  181.     {
  182.         if (!$this->perfilCargoAprueba->contains($perfilCargoAprueba)) {
  183.             $this->perfilCargoAprueba->add($perfilCargoAprueba);
  184.             $perfilCargoAprueba->setCargoAprueba($this);
  185.         }
  186.         return $this;
  187.     }
  188.     public function removePerfilCargoAprueba(GHPerfilCargo $perfilCargoAprueba): static
  189.     {
  190.         if ($this->perfilCargoAprueba->removeElement($perfilCargoAprueba)) {
  191.             // set the owning side to null (unless already changed)
  192.             if ($perfilCargoAprueba->getCargoAprueba() === $this) {
  193.                 $perfilCargoAprueba->setCargoAprueba(null);
  194.             }
  195.         }
  196.         return $this;
  197.     }
  198. }