<?php
namespace App\Entity;
use App\Repository\ParCargoRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ParCargoRepository::class)]
class ParCargo
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\OneToMany(mappedBy: 'cargo', targetEntity: GHPerfilCargo::class)]
private Collection $perfilCargo;
#[ORM\Column(length: 100)]
private ?string $nombre = null;
#[ORM\ManyToMany(targetEntity: GHPerfilCargo::class, mappedBy: 'personalCargo')]
private Collection $perfilPersonalCargo;
#[ORM\OneToMany(mappedBy: 'cargo', targetEntity: GHNovedadNomina::class)]
private Collection $novedadNomina;
#[ORM\ManyToMany(targetEntity: ParProceso::class, mappedBy: 'cargos')]
private Collection $procesos;
#[ORM\OneToMany(mappedBy: 'jefeInmediatoCargo', targetEntity: GHPerfilCargo::class)]
private Collection $perfilCargoJefeInmediato;
#[ORM\OneToMany(mappedBy: 'cargoAprueba', targetEntity: GHPerfilCargo::class)]
private Collection $perfilCargoAprueba;
public function __construct()
{
$this->perfilCargo = new ArrayCollection();
$this->perfilPersonalCargo = new ArrayCollection();
$this->novedadNomina = new ArrayCollection();
$this->procesos = new ArrayCollection();
$this->perfilCargoJefeInmediato = new ArrayCollection();
$this->perfilCargoAprueba = new ArrayCollection();
}
public function __toString() {
return $this->getNombre();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return Collection<int, GHPerfilCargo>
*/
public function getPerfilCargo(): Collection
{
return $this->perfilCargo;
}
public function addPerfilCargo(GHPerfilCargo $perfilCargo): static
{
if (!$this->perfilCargo->contains($perfilCargo)) {
$this->perfilCargo->add($perfilCargo);
$perfilCargo->setCargo($this);
}
return $this;
}
public function removePerfilCargo(GHPerfilCargo $perfilCargo): static
{
if ($this->perfilCargo->removeElement($perfilCargo)) {
// set the owning side to null (unless already changed)
if ($perfilCargo->getCargo() === $this) {
$perfilCargo->setCargo(null);
}
}
return $this;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(string $nombre): static
{
$this->nombre = $nombre;
return $this;
}
/**
* @return Collection<int, GHPerfilCargo>
*/
public function getPerfilPersonalCargo(): Collection
{
return $this->perfilPersonalCargo;
}
public function addPerfilPersonalCargo(GHPerfilCargo $perfilPersonalCargo): static
{
if (!$this->perfilPersonalCargo->contains($perfilPersonalCargo)) {
$this->perfilPersonalCargo->add($perfilPersonalCargo);
$perfilPersonalCargo->addPersonalCargo($this);
}
return $this;
}
public function removePerfilPersonalCargo(GHPerfilCargo $perfilPersonalCargo): static
{
if ($this->perfilPersonalCargo->removeElement($perfilPersonalCargo)) {
$perfilPersonalCargo->removePersonalCargo($this);
}
return $this;
}
/**
* @return Collection<int, GHNovedadNomina>
*/
public function getNovedadNomina(): Collection
{
return $this->novedadNomina;
}
public function addNovedadNomina(GHNovedadNomina $novedadNomina): static
{
if (!$this->novedadNomina->contains($novedadNomina)) {
$this->novedadNomina->add($novedadNomina);
$novedadNomina->setCargo($this);
}
return $this;
}
public function removeNovedadNomina(GHNovedadNomina $novedadNomina): static
{
if ($this->novedadNomina->removeElement($novedadNomina)) {
// set the owning side to null (unless already changed)
if ($novedadNomina->getCargo() === $this) {
$novedadNomina->setCargo(null);
}
}
return $this;
}
/**
* @return Collection<int, ParProceso>
*/
public function getProcesos(): Collection
{
return $this->procesos;
}
public function addProceso(ParProceso $proceso): static
{
if (!$this->procesos->contains($proceso)) {
$this->procesos->add($proceso);
$proceso->addCargo($this);
}
return $this;
}
public function removeProceso(ParProceso $proceso): static
{
if ($this->procesos->removeElement($proceso)) {
$proceso->removeCargo($this);
}
return $this;
}
/**
* @return Collection<int, GHPerfilCargo>
*/
public function getPerfilCargoJefeInmediato(): Collection
{
return $this->perfilCargoJefeInmediato;
}
public function addPerfilCargoJefeInmediato(GHPerfilCargo $perfilCargoJefeInmediato): static
{
if (!$this->perfilCargoJefeInmediato->contains($perfilCargoJefeInmediato)) {
$this->perfilCargoJefeInmediato->add($perfilCargoJefeInmediato);
$perfilCargoJefeInmediato->setJefeInmediatoCargo($this);
}
return $this;
}
public function removePerfilCargoJefeInmediato(GHPerfilCargo $perfilCargoJefeInmediato): static
{
if ($this->perfilCargoJefeInmediato->removeElement($perfilCargoJefeInmediato)) {
// set the owning side to null (unless already changed)
if ($perfilCargoJefeInmediato->getJefeInmediatoCargo() === $this) {
$perfilCargoJefeInmediato->setJefeInmediatoCargo(null);
}
}
return $this;
}
/**
* @return Collection<int, GHPerfilCargo>
*/
public function getPerfilCargoAprueba(): Collection
{
return $this->perfilCargoAprueba;
}
public function addPerfilCargoAprueba(GHPerfilCargo $perfilCargoAprueba): static
{
if (!$this->perfilCargoAprueba->contains($perfilCargoAprueba)) {
$this->perfilCargoAprueba->add($perfilCargoAprueba);
$perfilCargoAprueba->setCargoAprueba($this);
}
return $this;
}
public function removePerfilCargoAprueba(GHPerfilCargo $perfilCargoAprueba): static
{
if ($this->perfilCargoAprueba->removeElement($perfilCargoAprueba)) {
// set the owning side to null (unless already changed)
if ($perfilCargoAprueba->getCargoAprueba() === $this) {
$perfilCargoAprueba->setCargoAprueba(null);
}
}
return $this;
}
}