src/Entity/ParFondoPension.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParFondoPensionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParFondoPensionRepository::class)]
  8. class ParFondoPension
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $nombre null;
  16.     #[ORM\OneToMany(mappedBy'fondoPension'targetEntityTerPersona::class)]
  17.     private Collection $persona;
  18.     public function __construct()
  19.     {
  20.         $this->persona = new ArrayCollection();
  21.     }
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function getNombre(): ?string
  27.     {
  28.         return $this->nombre;
  29.     }
  30.     public function setNombre(string $nombre): static
  31.     {
  32.         $this->nombre $nombre;
  33.         return $this;
  34.     }
  35.     /**
  36.      * @return Collection<int, TerPersona>
  37.      */
  38.     public function getPersona(): Collection
  39.     {
  40.         return $this->persona;
  41.     }
  42.     public function addPersona(TerPersona $persona): static
  43.     {
  44.         if (!$this->persona->contains($persona)) {
  45.             $this->persona->add($persona);
  46.             $persona->setFondoPension($this);
  47.         }
  48.         return $this;
  49.     }
  50.     public function removePersona(TerPersona $persona): static
  51.     {
  52.         if ($this->persona->removeElement($persona)) {
  53.             // set the owning side to null (unless already changed)
  54.             if ($persona->getFondoPension() === $this) {
  55.                 $persona->setFondoPension(null);
  56.             }
  57.         }
  58.         return $this;
  59.     }
  60. }