src/Entity/Tarifa.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TarifaRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TarifaRepository::class)
  9.  */
  10. class Tarifa
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=TipoTarifa::class, inversedBy="tarifas")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $tipoTarifa;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $nombre;
  27.     /**
  28.      * @ORM\OneToMany(targetEntity=Producto::class, mappedBy="tarifa")
  29.      */
  30.     private $productos;
  31.     /**
  32.      * @ORM\OneToMany(targetEntity=Factura::class, mappedBy="tarifa")
  33.      */
  34.     private $facturas;
  35.     /**
  36.      * @ORM\OneToMany(targetEntity=ProductoProveedor::class, mappedBy="tarifa")
  37.      */
  38.     private $productoProveedors;
  39.     /**
  40.      * @ORM\OneToMany(targetEntity=FacturaGenerica::class, mappedBy="tarifa")
  41.      */
  42.     private $facturasGenericas;
  43.     /**
  44.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  45.      */
  46.     private $oculto;
  47.     /**
  48.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  49.      */
  50.     private $potenciaP1;
  51.     /**
  52.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  53.      */
  54.     private $potenciaP2;
  55.     /**
  56.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  57.      */
  58.     private $potenciaP3;
  59.     /**
  60.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  61.      */
  62.     private $potenciaP4;
  63.     /**
  64.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  65.      */
  66.     private $potenciaP5;
  67.     /**
  68.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  69.      */
  70.     private $potenciaP6;
  71.     /**
  72.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  73.      */
  74.     private $energiaP1;
  75.     /**
  76.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  77.      */
  78.     private $energiaP2;
  79.     /**
  80.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  81.      */
  82.     private $energiaP3;
  83.     /**
  84.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  85.      */
  86.     private $energiaP4;
  87.     /**
  88.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  89.      */
  90.     private $energiaP5;
  91.     /**
  92.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  93.      */
  94.     private $energiaP6;
  95.     /**
  96.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  97.      */
  98.     private $reactivaP1;
  99.     /**
  100.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  101.      */
  102.     private $reactivaP2;
  103.     /**
  104.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  105.      */
  106.     private $reactivaP3;
  107.     /**
  108.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  109.      */
  110.     private $reactivaP4;
  111.     /**
  112.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  113.      */
  114.     private $reactivaP5;
  115.     /**
  116.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  117.      */
  118.     private $reactivaP6;
  119.     /**
  120.      * @ORM\Column(type="boolean", nullable=false, options={"default": false})
  121.      */
  122.     private $maximetro;
  123.     public function __construct()
  124.     {
  125.         $this->productos = new ArrayCollection();
  126.         $this->productoProveedors = new ArrayCollection();
  127.         $this->facturasGenericas = new ArrayCollection();
  128.     }
  129.     public function getId(): ?int
  130.     {
  131.         return $this->id;
  132.     }
  133.     public function getTipoTarifa(): ?TipoTarifa
  134.     {
  135.         return $this->tipoTarifa;
  136.     }
  137.     public function setTipoTarifa(?TipoTarifa $tipoTarifa): self
  138.     {
  139.         $this->tipoTarifa $tipoTarifa;
  140.         return $this;
  141.     }
  142.     public function getNombre(): ?string
  143.     {
  144.         return $this->nombre;
  145.     }
  146.     public function setNombre(string $nombre): self
  147.     {
  148.         $this->nombre $nombre;
  149.         return $this;
  150.     }
  151.     /**
  152.      * @return Collection|Producto[]
  153.      */
  154.     public function getProductos(): Collection
  155.     {
  156.         return $this->productos;
  157.     }
  158.     public function addProducto(Producto $producto): self
  159.     {
  160.         if (!$this->productos->contains($producto)) {
  161.             $this->productos[] = $producto;
  162.             $producto->setTarifa($this);
  163.         }
  164.         return $this;
  165.     }
  166.     public function removeProducto(Producto $producto): self
  167.     {
  168.         if ($this->productos->contains($producto)) {
  169.             $this->productos->removeElement($producto);
  170.             // set the owning side to null (unless already changed)
  171.             if ($producto->getTarifa() === $this) {
  172.                 $producto->setTarifa(null);
  173.             }
  174.         }
  175.         return $this;
  176.     }
  177.     public function __toString():?string
  178.     {
  179.         return $this->nombre;
  180.     }
  181.     /**
  182.      * @return Collection|Factura[]
  183.      */
  184.     public function getFacturas(): Collection
  185.     {
  186.         return $this->facturas;
  187.     }
  188.     public function addFactura(Factura $factura): self
  189.     {
  190.         if (!$this->facturas->contains($factura)) {
  191.             $this->facturas[] = $factura;
  192.             $factura->setTarifa($this);
  193.         }
  194.         return $this;
  195.     }
  196.     public function removeFactura(Factura $factura): self
  197.     {
  198.         if ($this->facturas->contains($factura)) {
  199.             $this->facturas->removeElement($factura);
  200.             // set the owning side to null (unless already changed)
  201.             if ($factura->getTarifa() === $this) {
  202.                 $factura->setTarifa(null);
  203.             }
  204.         }
  205.         return $this;
  206.     }
  207.     /**
  208.      * @return Collection|ProductoProveedor[]
  209.      */
  210.     public function getProductoProveedors(): Collection
  211.     {
  212.         return $this->productoProveedors;
  213.     }
  214.     public function addProductoProveedor(ProductoProveedor $productoProveedor): self
  215.     {
  216.         if (!$this->productoProveedors->contains($productoProveedor)) {
  217.             $this->productoProveedors[] = $productoProveedor;
  218.             $productoProveedor->setTarifa($this);
  219.         }
  220.         return $this;
  221.     }
  222.     public function removeProductoProveedor(ProductoProveedor $productoProveedor): self
  223.     {
  224.         if ($this->productoProveedors->contains($productoProveedor)) {
  225.             $this->productoProveedors->removeElement($productoProveedor);
  226.             // set the owning side to null (unless already changed)
  227.             if ($productoProveedor->getTarifa() === $this) {
  228.                 $productoProveedor->setTarifa(null);
  229.             }
  230.         }
  231.         return $this;
  232.     }
  233.     /**
  234.      * @return Collection|FacturaGenerica[]
  235.      */
  236.     public function getFacturasGenericas(): Collection
  237.     {
  238.         return $this->facturasGenericas;
  239.     }
  240.     public function addFacturasGenerica(FacturaGenerica $facturasGenerica): self
  241.     {
  242.         if (!$this->facturasGenericas->contains($facturasGenerica)) {
  243.             $this->facturasGenericas[] = $facturasGenerica;
  244.             $facturasGenerica->setTarifa($this);
  245.         }
  246.         return $this;
  247.     }
  248.     public function removeFacturasGenerica(FacturaGenerica $facturasGenerica): self
  249.     {
  250.         if ($this->facturasGenericas->contains($facturasGenerica)) {
  251.             $this->facturasGenericas->removeElement($facturasGenerica);
  252.             // set the owning side to null (unless already changed)
  253.             if ($facturasGenerica->getTarifa() === $this) {
  254.                 $facturasGenerica->setTarifa(null);
  255.             }
  256.         }
  257.         return $this;
  258.     }
  259.     public function getOculto(): ?bool
  260.     {
  261.         return $this->oculto;
  262.     }
  263.     public function setOculto(?bool $oculto): self
  264.     {
  265.         $this->oculto $oculto;
  266.         return $this;
  267.     }
  268.     public function getPotenciaP1(): ?bool
  269.     {
  270.         return $this->potenciaP1;
  271.     }
  272.     public function setPotenciaP1(?bool $potenciaP1): self
  273.     {
  274.         $this->potenciaP1 $potenciaP1;
  275.         return $this;
  276.     }
  277.     public function getPotenciaP2(): ?bool
  278.     {
  279.         return $this->potenciaP2;
  280.     }
  281.     public function setPotenciaP2(?bool $potenciaP2): self
  282.     {
  283.         $this->potenciaP2 $potenciaP2;
  284.         return $this;
  285.     }
  286.     public function getPotenciaP3(): ?bool
  287.     {
  288.         return $this->potenciaP3;
  289.     }
  290.     public function setPotenciaP3(?bool $potenciaP3): self
  291.     {
  292.         $this->potenciaP3 $potenciaP3;
  293.         return $this;
  294.     }
  295.     public function getPotenciaP4(): ?bool
  296.     {
  297.         return $this->potenciaP4;
  298.     }
  299.     public function setPotenciaP4(?bool $potenciaP4): self
  300.     {
  301.         $this->potenciaP4 $potenciaP4;
  302.         return $this;
  303.     }
  304.     public function getPotenciaP5(): ?bool
  305.     {
  306.         return $this->potenciaP5;
  307.     }
  308.     public function setPotenciaP5(?bool $potenciaP5): self
  309.     {
  310.         $this->potenciaP5 $potenciaP5;
  311.         return $this;
  312.     }
  313.     public function getPotenciaP6(): ?bool
  314.     {
  315.         return $this->potenciaP6;
  316.     }
  317.     public function setPotenciaP6(?bool $potenciaP6): self
  318.     {
  319.         $this->potenciaP6 $potenciaP6;
  320.         return $this;
  321.     }
  322.     public function getEnergiaP1(): ?bool
  323.     {
  324.         return $this->energiaP1;
  325.     }
  326.     public function setEnergiaP1(?bool $energiaP1): self
  327.     {
  328.         $this->energiaP1 $energiaP1;
  329.         return $this;
  330.     }
  331.     public function getEnergiaP2(): ?bool
  332.     {
  333.         return $this->energiaP2;
  334.     }
  335.     public function setEnergiaP2(?bool $energiaP2): self
  336.     {
  337.         $this->energiaP2 $energiaP2;
  338.         return $this;
  339.     }
  340.     public function getEnergiaP3(): ?bool
  341.     {
  342.         return $this->energiaP3;
  343.     }
  344.     public function setEnergiaP3(?bool $energiaP3): self
  345.     {
  346.         $this->energiaP3 $energiaP3;
  347.         return $this;
  348.     }
  349.     public function getEnergiaP4(): ?bool
  350.     {
  351.         return $this->energiaP4;
  352.     }
  353.     public function setEnergiaP4(?bool $energiaP4): self
  354.     {
  355.         $this->energiaP4 $energiaP4;
  356.         return $this;
  357.     }
  358.     public function getEnergiaP5(): ?bool
  359.     {
  360.         return $this->energiaP5;
  361.     }
  362.     public function setEnergiaP5(?bool $energiaP5): self
  363.     {
  364.         $this->energiaP5 $energiaP5;
  365.         return $this;
  366.     }
  367.     public function getEnergiaP6(): ?bool
  368.     {
  369.         return $this->energiaP6;
  370.     }
  371.     public function setEnergiaP6(?bool $energiaP6): self
  372.     {
  373.         $this->energiaP6 $energiaP6;
  374.         return $this;
  375.     }
  376.     public function getReactivaP1(): ?bool
  377.     {
  378.         return $this->reactivaP1;
  379.     }
  380.     public function setReactivaP1(?bool $reactivaP1): self
  381.     {
  382.         $this->reactivaP1 $reactivaP1;
  383.         return $this;
  384.     }
  385.     public function getReactivaP2(): ?bool
  386.     {
  387.         return $this->reactivaP2;
  388.     }
  389.     public function setReactivaP2(?bool $reactivaP2): self
  390.     {
  391.         $this->reactivaP2 $reactivaP2;
  392.         return $this;
  393.     }
  394.     public function getReactivaP3(): ?bool
  395.     {
  396.         return $this->reactivaP3;
  397.     }
  398.     public function setReactivaP3(?bool $reactivaP3): self
  399.     {
  400.         $this->reactivaP3 $reactivaP3;
  401.         return $this;
  402.     }
  403.     public function getReactivaP4(): ?bool
  404.     {
  405.         return $this->reactivaP4;
  406.     }
  407.     public function setReactivaP4(?bool $reactivaP4): self
  408.     {
  409.         $this->reactivaP4 $reactivaP4;
  410.         return $this;
  411.     }
  412.     public function getReactivaP5(): ?bool
  413.     {
  414.         return $this->reactivaP5;
  415.     }
  416.     public function setReactivaP5(?bool $reactivaP5): self
  417.     {
  418.         $this->reactivaP5 $reactivaP5;
  419.         return $this;
  420.     }
  421.     public function getReactivaP6(): ?bool
  422.     {
  423.         return $this->reactivaP6;
  424.     }
  425.     public function setReactivaP6(?bool $reactivaP6): self
  426.     {
  427.         $this->reactivaP6 $reactivaP6;
  428.         return $this;
  429.     }
  430.     public function getMaximetro(): ?bool
  431.     {
  432.         return $this->maximetro;
  433.     }
  434.     public function setMaximetro(?bool $maximetro): self
  435.     {
  436.         $this->maximetro $maximetro;
  437.         return $this;
  438.     }
  439. }