src/Entity/ParTipoPaquete.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParTipoPaqueteRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParTipoPaqueteRepository::class)]
  8. class ParTipoPaquete
  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\ManyToOne(inversedBy'tipoPaquete')]
  17.     private ?ParEstado $estado null;
  18.     #[ORM\OneToMany(mappedBy'tipoPaquete'targetEntityRFPaquete::class)]
  19.     private Collection $paquete;
  20.     public function __construct()
  21.     {
  22.         $this->paquete = new ArrayCollection();
  23.     }
  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.     public function getEstado(): ?ParEstado
  42.     {
  43.         return $this->estado;
  44.     }
  45.     public function setEstado(?ParEstado $estado): static
  46.     {
  47.         $this->estado $estado;
  48.         return $this;
  49.     }
  50.     /**
  51.      * @return Collection<int, RFPaquete>
  52.      */
  53.     public function getPaquete(): Collection
  54.     {
  55.         return $this->paquete;
  56.     }
  57.     public function addPaquete(RFPaquete $paquete): static
  58.     {
  59.         if (!$this->paquete->contains($paquete)) {
  60.             $this->paquete->add($paquete);
  61.             $paquete->setFuente($this);
  62.         }
  63.         return $this;
  64.     }
  65.     public function removePaquete(RFPaquete $paquete): static
  66.     {
  67.         if ($this->paquete->removeElement($paquete)) {
  68.             // set the owning side to null (unless already changed)
  69.             if ($paquete->getFuente() === $this) {
  70.                 $paquete->setFuente(null);
  71.             }
  72.         }
  73.         return $this;
  74.     }
  75.    
  76. }