src/Entity/ParFondoCesantias.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParFondoCesantiasRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParFondoCesantiasRepository::class)]
  8. class ParFondoCesantias
  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'fondoCesantias'targetEntityTerPersona::class)]
  17.     private Collection $persona;
  18.     #[ORM\OneToMany(mappedBy'fondoCesantias'targetEntityGHRetiroCesantias::class)]
  19.     private Collection $retiroCesantias;
  20.     public function __construct()
  21.     {
  22.         $this->persona = new ArrayCollection();
  23.         $this->retiroCesantias = new ArrayCollection();
  24.     }
  25.     public function __toString() {
  26.         return $this->getNombre();
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getNombre(): ?string
  33.     {
  34.         return $this->nombre;
  35.     }
  36.     public function setNombre(string $nombre): static
  37.     {
  38.         $this->nombre $nombre;
  39.         return $this;
  40.     }
  41.     /**
  42.      * @return Collection<int, TerPersona>
  43.      */
  44.     public function getPersona(): Collection
  45.     {
  46.         return $this->persona;
  47.     }
  48.     public function addPersona(TerPersona $persona): static
  49.     {
  50.         if (!$this->persona->contains($persona)) {
  51.             $this->persona->add($persona);
  52.             $persona->setFondoCesantias($this);
  53.         }
  54.         return $this;
  55.     }
  56.     public function removePersona(TerPersona $persona): static
  57.     {
  58.         if ($this->persona->removeElement($persona)) {
  59.             // set the owning side to null (unless already changed)
  60.             if ($persona->getFondoCesantias() === $this) {
  61.                 $persona->setFondoCesantias(null);
  62.             }
  63.         }
  64.         return $this;
  65.     }
  66.     /**
  67.      * @return Collection<int, GHRetiroCesantias>
  68.      */
  69.     public function getRetiroCesantias(): Collection
  70.     {
  71.         return $this->retiroCesantias;
  72.     }
  73.     public function addRetiroCesantia(GHRetiroCesantias $retiroCesantia): static
  74.     {
  75.         if (!$this->retiroCesantias->contains($retiroCesantia)) {
  76.             $this->retiroCesantias->add($retiroCesantia);
  77.             $retiroCesantia->setFondoCesantias($this);
  78.         }
  79.         return $this;
  80.     }
  81.     public function removeRetiroCesantia(GHRetiroCesantias $retiroCesantia): static
  82.     {
  83.         if ($this->retiroCesantias->removeElement($retiroCesantia)) {
  84.             // set the owning side to null (unless already changed)
  85.             if ($retiroCesantia->getFondoCesantias() === $this) {
  86.                 $retiroCesantia->setFondoCesantias(null);
  87.             }
  88.         }
  89.         return $this;
  90.     }
  91. }