src/Entity/ComTipoAsociado.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ComTipoAsociadoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassComTipoAsociadoRepository::class)]
  8. class ComTipoAsociado
  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'tipoAsociado'targetEntityComProspecto::class)]
  17.     private Collection $comTipoAsociado;
  18.     #[ORM\OneToMany(mappedBy'tipoAsociado'targetEntityTerEmpresaCliente::class)]
  19.     private Collection $terEmpresaClientes;
  20.     public function __construct()
  21.     {
  22.         $this->comTipoAsociado = new ArrayCollection();
  23.         $this->terEmpresaClientes = new ArrayCollection();
  24.     }
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getNombre(): ?string
  30.     {
  31.         return $this->nombre;
  32.     }
  33.     public function setNombre(string $nombre): static
  34.     {
  35.         $this->nombre $nombre;
  36.         return $this;
  37.     }
  38.     /**
  39.      * @return Collection<int, ComProspecto>
  40.      */
  41.     public function getComTipoAsociado(): Collection
  42.     {
  43.         return $this->comTipoAsociado;
  44.     }
  45.     public function addComTipoAsociado(ComProspecto $comTipoAsociado): static
  46.     {
  47.         if (!$this->comTipoAsociado->contains($comTipoAsociado)) {
  48.             $this->comTipoAsociado->add($comTipoAsociado);
  49.             $comTipoAsociado->setTipoAsociado($this);
  50.         }
  51.         return $this;
  52.     }
  53.     public function removeComTipoAsociado(ComProspecto $comTipoAsociado): static
  54.     {
  55.         if ($this->comTipoAsociado->removeElement($comTipoAsociado)) {
  56.             // set the owning side to null (unless already changed)
  57.             if ($comTipoAsociado->getTipoAsociado() === $this) {
  58.                 $comTipoAsociado->setTipoAsociado(null);
  59.             }
  60.         }
  61.         return $this;
  62.     }
  63.     /**
  64.      * @return Collection<int, TerEmpresaCliente>
  65.      */
  66.     public function getTerEmpresaClientes(): Collection
  67.     {
  68.         return $this->terEmpresaClientes;
  69.     }
  70.     public function addTerEmpresaCliente(TerEmpresaCliente $terEmpresaCliente): static
  71.     {
  72.         if (!$this->terEmpresaClientes->contains($terEmpresaCliente)) {
  73.             $this->terEmpresaClientes->add($terEmpresaCliente);
  74.             $terEmpresaCliente->setTipoAsociado($this);
  75.         }
  76.         return $this;
  77.     }
  78.     public function removeTerEmpresaCliente(TerEmpresaCliente $terEmpresaCliente): static
  79.     {
  80.         if ($this->terEmpresaClientes->removeElement($terEmpresaCliente)) {
  81.             // set the owning side to null (unless already changed)
  82.             if ($terEmpresaCliente->getTipoAsociado() === $this) {
  83.                 $terEmpresaCliente->setTipoAsociado(null);
  84.             }
  85.         }
  86.         return $this;
  87.     }
  88. }