src/Entity/ParTenenciaResidencia.php line 11

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