src/Entity/Impuesto.php line 13

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