src/Entity/ParNivelAutoridad.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParNivelAutoridadRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParNivelAutoridadRepository::class)]
  8. class ParNivelAutoridad
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\OneToMany(mappedBy'ParNivelAutoridad'targetEntityGHPerfilCargo::class)]
  15.     private Collection $idPerfilCargo;
  16.     #[ORM\Column(length100)]
  17.     private ?string $nombre null;
  18.     #[ORM\Column(type'text'nullabletrue)]
  19.     private ?string $descripcion null;
  20.     public function __construct()
  21.     {
  22.         $this->idPerfilCargo = new ArrayCollection();
  23.     }
  24.     
  25.     public function __toString() {
  26.         return $this->getNombre();
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     /**
  33.      * @return Collection<int, GHPerfilCargo>
  34.      */
  35.     public function getIdPerfilCargo(): Collection
  36.     {
  37.         return $this->idPerfilCargo;
  38.     }
  39.     public function addIdPerfilCargo(GHPerfilCargo $idPerfilCargo): static
  40.     {
  41.         if (!$this->idPerfilCargo->contains($idPerfilCargo)) {
  42.             $this->idPerfilCargo->add($idPerfilCargo);
  43.             $idPerfilCargo->setParNivelAutoridad($this);
  44.         }
  45.         return $this;
  46.     }
  47.     public function removeIdPerfilCargo(GHPerfilCargo $idPerfilCargo): static
  48.     {
  49.         if ($this->idPerfilCargo->removeElement($idPerfilCargo)) {
  50.             // set the owning side to null (unless already changed)
  51.             if ($idPerfilCargo->getParNivelAutoridad() === $this) {
  52.                 $idPerfilCargo->setParNivelAutoridad(null);
  53.             }
  54.         }
  55.         return $this;
  56.     }
  57.     public function getNombre(): ?string
  58.     {
  59.         return $this->nombre;
  60.     }
  61.     public function setNombre(string $nombre): static
  62.     {
  63.         $this->nombre $nombre;
  64.         return $this;
  65.     }
  66.     /**
  67.      * Obtiene la descripción del nivel de autoridad.
  68.      */
  69.     public function getDescripcion(): ?string
  70.     {
  71.         return $this->descripcion;
  72.     }
  73.     /**
  74.      * Establece la descripción del nivel de autoridad.
  75.      */
  76.     public function setDescripcion(?string $descripcion): static
  77.     {
  78.         $this->descripcion $descripcion;
  79.         return $this;
  80.     }
  81. }