<?phpnamespace App\Entity;use App\Repository\ParGeneroRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ParGeneroRepository::class)]class ParGenero { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 50)] private ?string $nombre = null; #[ORM\OneToMany(mappedBy: 'genero', targetEntity: TerContactoPersona::class)] private Collection $contactoPersona; #[ORM\OneToMany(mappedBy: 'genero', targetEntity: GHEntrevista::class)] private Collection $entrevista; public function __toString() { return $this->getNombre(); } public function __construct() { $this->contactoPersona = new ArrayCollection(); $this->entrevista = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getNombre(): ?string { return $this->nombre; } public function setNombre(string $nombre): static { $this->nombre = $nombre; return $this; } /** * @return Collection<int, TerContactoPersona> */ public function getContactoPersona(): Collection { return $this->contactoPersona; } public function addContactoPersona(TerContactoPersona $contactoPersona): static { if (!$this->contactoPersona->contains($contactoPersona)) { $this->contactoPersona->add($contactoPersona); $contactoPersona->setGenero($this); } return $this; } public function removeContactoPersona(TerContactoPersona $contactoPersona): static { if ($this->contactoPersona->removeElement($contactoPersona)) { // set the owning side to null (unless already changed) if ($contactoPersona->getGenero() === $this) { $contactoPersona->setGenero(null); } } return $this; } /** * @return Collection<int, GHEntrevista> */ public function getEntrevista(): Collection { return $this->entrevista; } public function addEntrevistum(GHEntrevista $entrevistum): static { if (!$this->entrevista->contains($entrevistum)) { $this->entrevista->add($entrevistum); $entrevistum->setGenero($this); } return $this; } public function removeEntrevistum(GHEntrevista $entrevistum): static { if ($this->entrevista->removeElement($entrevistum)) { // set the owning side to null (unless already changed) if ($entrevistum->getGenero() === $this) { $entrevistum->setGenero(null); } } return $this; }}