src/Entity/TipoImpuesto.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TipoImpuestoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TipoImpuestoRepository::class)
  9.  */
  10. class TipoImpuesto
  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="tipoImpuesto")
  24.      */
  25.     private $contratos;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=Impuesto::class, inversedBy="tipoImpuestos")
  28.      */
  29.     private $impuesto;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity=TipoTarifa::class, inversedBy="tipoImpuestos")
  32.      */
  33.     private $tipoTarifa;
  34.     public function __construct()
  35.     {
  36.         $this->contratos = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getNombre(): ?string
  43.     {
  44.         return $this->nombre;
  45.     }
  46.     public function setNombre(string $nombre): self
  47.     {
  48.         $this->nombre $nombre;
  49.         return $this;
  50.     }
  51.     /**
  52.      * @return Collection|Contrato[]
  53.      */
  54.     public function getContratos(): Collection
  55.     {
  56.         return $this->contratos;
  57.     }
  58.     public function addContrato(Contrato $contrato): self
  59.     {
  60.         if (!$this->contratos->contains($contrato)) {
  61.             $this->contratos[] = $contrato;
  62.             $contrato->setTipoImpuesto($this);
  63.         }
  64.         return $this;
  65.     }
  66.     public function removeProducto(Contrato $contrato): self
  67.     {
  68.         if ($this->contratos->contains($contrato)) {
  69.             $this->contratos->removeElement($contrato);
  70.             // set the owning side to null (unless already changed)
  71.             if ($contrato->getTipoImpuesto() === $this) {
  72.                 $contrato->setTipoImpuesto(null);
  73.             }
  74.         }
  75.         return $this;
  76.     }
  77.     public function __toString():?string
  78.     {
  79.         return $this->nombre;
  80.     }
  81.     public function getImpuesto(): ?Impuesto
  82.     {
  83.         return $this->impuesto;
  84.     }
  85.     public function setImpuesto(?Impuesto $impuesto): self
  86.     {
  87.         $this->impuesto $impuesto;
  88.         return $this;
  89.     }
  90.     public function getTipoTarifa(): ?TipoTarifa
  91.     {
  92.         return $this->tipoTarifa;
  93.     }
  94.     public function setTipoTarifa(?TipoTarifa $tipoTarifa): self
  95.     {
  96.         $this->tipoTarifa $tipoTarifa;
  97.         return $this;
  98.     }
  99. }