src/Entity/TipoTarifa.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TipoTarifaRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TipoTarifaRepository::class)
  9.  */
  10. class TipoTarifa
  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=Tarifa::class, mappedBy="tipoTarifa")
  24.      */
  25.     private $tarifas;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=TipoImpuesto::class, mappedBy="tipoTarifa")
  28.      */
  29.     private $tipoImpuestos;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=TipoIva::class, mappedBy="tipoTarifa")
  32.      */
  33.     private $tipoIvas;
  34.     public function __construct()
  35.     {
  36.         $this->tarifas = new ArrayCollection();
  37.         $this->facturas = new ArrayCollection();
  38.         $this->tipoImpuestos = new ArrayCollection();
  39.         $this->tipoIvas = new ArrayCollection();
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getNombre(): ?string
  46.     {
  47.         return $this->nombre;
  48.     }
  49.     public function setNombre(string $nombre): self
  50.     {
  51.         $this->nombre $nombre;
  52.         return $this;
  53.     }
  54.     /**
  55.      * @return Collection|Tarifa[]
  56.      */
  57.     public function getTarifas(): Collection
  58.     {
  59.         return $this->tarifas;
  60.     }
  61.     public function addTarifa(Tarifa $tarifa): self
  62.     {
  63.         if (!$this->tarifas->contains($tarifa)) {
  64.             $this->tarifas[] = $tarifa;
  65.             $tarifa->setTipoTarifa($this);
  66.         }
  67.         return $this;
  68.     }
  69.     public function removeTarifa(Tarifa $tarifa): self
  70.     {
  71.         if ($this->tarifas->contains($tarifa)) {
  72.             $this->tarifas->removeElement($tarifa);
  73.             // set the owning side to null (unless already changed)
  74.             if ($tarifa->getTipoTarifa() === $this) {
  75.                 $tarifa->setTipoTarifa(null);
  76.             }
  77.         }
  78.         return $this;
  79.     }
  80.     public function __toString(): string
  81.     {
  82.         return $this->nombre;
  83.     }
  84.     /**
  85.      * @return Collection<int, TipoImpuesto>
  86.      */
  87.     public function getTipoImpuestos(): Collection
  88.     {
  89.         return $this->tipoImpuestos;
  90.     }
  91.     public function addTipoImpuesto(TipoImpuesto $tipoImpuesto): self
  92.     {
  93.         if (!$this->tipoImpuestos->contains($tipoImpuesto)) {
  94.             $this->tipoImpuestos[] = $tipoImpuesto;
  95.             $tipoImpuesto->setTipoTarifa($this);
  96.         }
  97.         return $this;
  98.     }
  99.     public function removeTipoImpuesto(TipoImpuesto $tipoImpuesto): self
  100.     {
  101.         if ($this->tipoImpuestos->removeElement($tipoImpuesto)) {
  102.             // set the owning side to null (unless already changed)
  103.             if ($tipoImpuesto->getTipoTarifa() === $this) {
  104.                 $tipoImpuesto->setTipoTarifa(null);
  105.             }
  106.         }
  107.         return $this;
  108.     }
  109.     /**
  110.      * @return Collection<int, TipoIva>
  111.      */
  112.     public function getTipoIvas(): Collection
  113.     {
  114.         return $this->tipoIvas;
  115.     }
  116.     public function addTipoIva(TipoIva $tipoIva): self
  117.     {
  118.         if (!$this->tipoIvas->contains($tipoIva)) {
  119.             $this->tipoIvas[] = $tipoIva;
  120.             $tipoIva->setTipoTarifa($this);
  121.         }
  122.         return $this;
  123.     }
  124.     public function removeTipoIva(TipoIva $tipoIva): self
  125.     {
  126.         if ($this->tipoIvas->removeElement($tipoIva)) {
  127.             // set the owning side to null (unless already changed)
  128.             if ($tipoIva->getTipoTarifa() === $this) {
  129.                 $tipoIva->setTipoTarifa(null);
  130.             }
  131.         }
  132.         return $this;
  133.     }
  134. }