src/Entity/ParParentesco.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParParentescoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParParentescoRepository::class)]
  8. class ParParentesco
  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'parentesco'targetEntityGHEntrevistaInfoFamiliar::class)]
  17.     private Collection $entrevistaInfoFamiliar;
  18.     #[ORM\OneToMany(mappedBy'parentesco'targetEntityTerContactoPersona::class)]
  19.     private Collection $contactoPersona;
  20.     public function __construct()
  21.     {
  22.         $this->entrevistaInfoFamiliar = new ArrayCollection();
  23.         $this->contactoPersona = new ArrayCollection();
  24.     }
  25.      public function __toString() {
  26.         return $this->getNombre();
  27.     }
  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, GHEntrevistaInfoFamiliar>
  44.      */
  45.     public function getEntrevistaInfoFamiliar(): Collection
  46.     {
  47.         return $this->entrevistaInfoFamiliar;
  48.     }
  49.     public function addEntrevistaInfoFamiliar(GHEntrevistaInfoFamiliar $entrevistaInfoFamiliar): static
  50.     {
  51.         if (!$this->entrevistaInfoFamiliar->contains($entrevistaInfoFamiliar)) {
  52.             $this->entrevistaInfoFamiliar->add($entrevistaInfoFamiliar);
  53.             $entrevistaInfoFamiliar->setParentescoId($this);
  54.         }
  55.         return $this;
  56.     }
  57.     public function removeEntrevistaInfoFamiliar(GHEntrevistaInfoFamiliar $entrevistaInfoFamiliar): static
  58.     {
  59.         if ($this->entrevistaInfoFamiliar->removeElement($entrevistaInfoFamiliar)) {
  60.             // set the owning side to null (unless already changed)
  61.             if ($entrevistaInfoFamiliar->getParentescoId() === $this) {
  62.                 $entrevistaInfoFamiliar->setParentescoId(null);
  63.             }
  64.         }
  65.         return $this;
  66.     }
  67.     /**
  68.      * @return Collection<int, TerContactoPersona>
  69.      */
  70.     public function getContactoPersona(): Collection
  71.     {
  72.         return $this->contactoPersona;
  73.     }
  74.     public function addContactoPersona(TerContactoPersona $contactoPersona): static
  75.     {
  76.         if (!$this->contactoPersona->contains($contactoPersona)) {
  77.             $this->contactoPersona->add($contactoPersona);
  78.             $contactoPersona->setParentesco($this);
  79.         }
  80.         return $this;
  81.     }
  82.     public function removeContactoPersona(TerContactoPersona $contactoPersona): static
  83.     {
  84.         if ($this->contactoPersona->removeElement($contactoPersona)) {
  85.             // set the owning side to null (unless already changed)
  86.             if ($contactoPersona->getParentesco() === $this) {
  87.                 $contactoPersona->setParentesco(null);
  88.             }
  89.         }
  90.         return $this;
  91.     }
  92. }