src/Entity/EstadoComision.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EstadoComisionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=EstadoComisionRepository::class)
  9.  */
  10. class EstadoComision
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $nombre;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=Contrato::class, mappedBy="comisionCobrada")
  24.      */
  25.     private $contratosCobrados;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=Contrato::class, mappedBy="comisionPagada")
  28.      */
  29.     private $contratosPagados;
  30.     public function __construct()
  31.     {
  32.         $this->contratosCobrados = new ArrayCollection();
  33.         $this->contratosPagados = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getNombre(): ?string
  40.     {
  41.         return $this->nombre;
  42.     }
  43.     public function setNombre(string $nombre): self
  44.     {
  45.         $this->nombre $nombre;
  46.         return $this;
  47.     }
  48.     /**
  49.      * @return Collection|Contrato[]
  50.      */
  51.     public function getContratosCobrados(): Collection
  52.     {
  53.         return $this->contratosCobrados;
  54.     }
  55.     public function addContratosCobrado(Contrato $contratosCobrado): self
  56.     {
  57.         if (!$this->contratosCobrados->contains($contratosCobrado)) {
  58.             $this->contratosCobrados[] = $contratosCobrado;
  59.             $contratosCobrado->setComisionCobrada($this);
  60.         }
  61.         return $this;
  62.     }
  63.     public function removeContratosCobrado(Contrato $contratosCobrado): self
  64.     {
  65.         if ($this->contratosCobrados->removeElement($contratosCobrado)) {
  66.             // set the owning side to null (unless already changed)
  67.             if ($contratosCobrado->getComisionCobrada() === $this) {
  68.                 $contratosCobrado->setComisionCobrada(null);
  69.             }
  70.         }
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection|Contrato[]
  75.      */
  76.     public function getContratosPagados(): Collection
  77.     {
  78.         return $this->contratosPagados;
  79.     }
  80.     public function addContratosPagado(Contrato $contratosPagado): self
  81.     {
  82.         if (!$this->contratosPagados->contains($contratosPagado)) {
  83.             $this->contratosPagados[] = $contratosPagado;
  84.             $contratosPagado->setComisionPagada($this);
  85.         }
  86.         return $this;
  87.     }
  88.     public function removeContratosPagado(Contrato $contratosPagado): self
  89.     {
  90.         if ($this->contratosPagados->removeElement($contratosPagado)) {
  91.             // set the owning side to null (unless already changed)
  92.             if ($contratosPagado->getComisionPagada() === $this) {
  93.                 $contratosPagado->setComisionPagada(null);
  94.             }
  95.         }
  96.         return $this;
  97.     }
  98.     public function __toString(): string
  99.     {
  100.         return $this->nombre;
  101.     }
  102. }