src/Entity/ParGenero.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParGeneroRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParGeneroRepository::class)]
  8. class ParGenero {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\Column(length50)]
  14.     private ?string $nombre null;
  15.     #[ORM\OneToMany(mappedBy'genero'targetEntityTerContactoPersona::class)]
  16.     private Collection $contactoPersona;
  17.     #[ORM\OneToMany(mappedBy'genero'targetEntityGHEntrevista::class)]
  18.     private Collection $entrevista;
  19.     public function __toString() {
  20.         return $this->getNombre();
  21.     }
  22.     public function __construct() {
  23.         $this->contactoPersona = new ArrayCollection();
  24.         $this->entrevista = new ArrayCollection();
  25.     }
  26.     public function getId(): ?int {
  27.         return $this->id;
  28.     }
  29.     public function getNombre(): ?string {
  30.         return $this->nombre;
  31.     }
  32.     public function setNombre(string $nombre): static {
  33.         $this->nombre $nombre;
  34.         return $this;
  35.     }
  36.     /**
  37.      * @return Collection<int, TerContactoPersona>
  38.      */
  39.     public function getContactoPersona(): Collection {
  40.         return $this->contactoPersona;
  41.     }
  42.     public function addContactoPersona(TerContactoPersona $contactoPersona): static {
  43.         if (!$this->contactoPersona->contains($contactoPersona)) {
  44.             $this->contactoPersona->add($contactoPersona);
  45.             $contactoPersona->setGenero($this);
  46.         }
  47.         return $this;
  48.     }
  49.     public function removeContactoPersona(TerContactoPersona $contactoPersona): static {
  50.         if ($this->contactoPersona->removeElement($contactoPersona)) {
  51.             // set the owning side to null (unless already changed)
  52.             if ($contactoPersona->getGenero() === $this) {
  53.                 $contactoPersona->setGenero(null);
  54.             }
  55.         }
  56.         return $this;
  57.     }
  58.     /**
  59.      * @return Collection<int, GHEntrevista>
  60.      */
  61.     public function getEntrevista(): Collection {
  62.         return $this->entrevista;
  63.     }
  64.     public function addEntrevistum(GHEntrevista $entrevistum): static {
  65.         if (!$this->entrevista->contains($entrevistum)) {
  66.             $this->entrevista->add($entrevistum);
  67.             $entrevistum->setGenero($this);
  68.         }
  69.         return $this;
  70.     }
  71.     public function removeEntrevistum(GHEntrevista $entrevistum): static {
  72.         if ($this->entrevista->removeElement($entrevistum)) {
  73.             // set the owning side to null (unless already changed)
  74.             if ($entrevistum->getGenero() === $this) {
  75.                 $entrevistum->setGenero(null);
  76.             }
  77.         }
  78.         return $this;
  79.     }
  80. }