src/Entity/ParTipoPerfil.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParTipoPerfilRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParTipoPerfilRepository::class)]
  8. class ParTipoPerfil
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length100)]
  15.     private ?string $perfil null;
  16.     #[ORM\OneToMany(mappedBy'ParTipoPerfil'targetEntityGHPerfilCargo::class)]
  17.     private Collection $idPerfilCargo;
  18.     public function __construct()
  19.     {
  20.         $this->idPerfilCargo = new ArrayCollection();
  21.     }
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function getPerfil(): ?string
  27.     {
  28.         return $this->perfil;
  29.     }
  30.     public function setPerfil(string $perfil): static
  31.     {
  32.         $this->perfil $perfil;
  33.         return $this;
  34.     }
  35.     
  36.     public function __toString() {
  37.         return $this->getPerfil();
  38.     }
  39.     /**
  40.      * @return Collection<int, GHPerfilCargo>
  41.      */
  42.     public function getIdPerfilCargo(): Collection
  43.     {
  44.         return $this->idPerfilCargo;
  45.     }
  46.     public function addIdPerfilCargo(GHPerfilCargo $idPerfilCargo): static
  47.     {
  48.         if (!$this->idPerfilCargo->contains($idPerfilCargo)) {
  49.             $this->idPerfilCargo->add($idPerfilCargo);
  50.             $idPerfilCargo->setParTipoPerfil($this);
  51.         }
  52.         return $this;
  53.     }
  54.     public function removeIdPerfilCargo(GHPerfilCargo $idPerfilCargo): static
  55.     {
  56.         if ($this->idPerfilCargo->removeElement($idPerfilCargo)) {
  57.             // set the owning side to null (unless already changed)
  58.             if ($idPerfilCargo->getParTipoPerfil() === $this) {
  59.                 $idPerfilCargo->setParTipoPerfil(null);
  60.             }
  61.         }
  62.         return $this;
  63.     }
  64. }