src/Entity/TipoIva.php line 13

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