src/Entity/ParInversion.php line 11

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