src/Entity/Mesas.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MesasRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=MesasRepository::class)
  9.  */
  10. class Mesas
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string")
  20.      */
  21.     private $numero;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=Ventas::class, mappedBy="mesa")
  24.      */
  25.     private $ventas;
  26.     /**
  27.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  28.      */
  29.     private $pagado;
  30.     /**
  31.      * @ORM\Column(type="decimal", precision=10, scale=2)
  32.      */
  33.     private $por_pagar;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=Pedidos::class, mappedBy="mesa")
  36.      */
  37.     private $pedidos;
  38.     /**
  39.      * @ORM\Column(type="simple_array", nullable=true)
  40.      */
  41.     private $union_mesas = [];
  42.     /**
  43.      * @ORM\Column(type="string", length=50)
  44.      */
  45.     private $localizacion;
  46.     /**
  47.      * @ORM\ManyToOne(targetEntity=Zonas::class, inversedBy="mesas")
  48.      */
  49.     private $zonas;
  50.     /**
  51.      * @ORM\Column(type="integer", nullable=true)
  52.      */
  53.     private $comensales;
  54.     /**
  55.      * @ORM\Column(type="boolean", nullable=true)
  56.      */
  57.     private $factura;
  58.     /**
  59.      * @ORM\OneToMany(targetEntity=Tickets::class, mappedBy="mesaid")
  60.      */
  61.     private $tickets;
  62.     /**
  63.      * @ORM\Column(type="float", nullable=true)
  64.      */
  65.     private $coord_x;
  66.     /**
  67.      * @ORM\Column(type="float", nullable=true)
  68.      */
  69.     private $coord_y;
  70.     /**
  71.      * @ORM\Column(type="string", length=255, nullable=true)
  72.      */
  73.     private $icon;
  74.     /**
  75.      * @ORM\OneToMany(targetEntity=Statscomida::class, mappedBy="mesa")
  76.      */
  77.     private $statscomidas;
  78.     /**
  79.      * @ORM\OneToMany(targetEntity=Statscomensales::class, mappedBy="mesa")
  80.      */
  81.     private $statscomensales;
  82.     
  83.     public function __construct()
  84.     {
  85.         $this->ventas = new ArrayCollection();
  86.         $this->pedidos = new ArrayCollection();
  87.         $this->tickets = new ArrayCollection();
  88.         $this->statscomidas = new ArrayCollection();
  89.         $this->statscomensales = new ArrayCollection();
  90.     }
  91.     public function getId(): ?int
  92.     {
  93.         return $this->id;
  94.     }
  95.     public function getNumero(): ?string
  96.     {
  97.         return $this->numero;
  98.     }
  99.     public function setNumero(string $numero): self
  100.     {
  101.         $this->numero $numero;
  102.         return $this;
  103.     }
  104.     /**
  105.      * @return Collection<int, Ventas>
  106.      */
  107.     public function getVentas(): Collection
  108.     {
  109.         return $this->ventas;
  110.     }
  111.     public function addVenta(Ventas $venta): self
  112.     {
  113.         if (!$this->ventas->contains($venta)) {
  114.             $this->ventas[] = $venta;
  115.             $venta->setMesa($this);
  116.         }
  117.         return $this;
  118.     }
  119.     public function removeVenta(Ventas $venta): self
  120.     {
  121.         if ($this->ventas->removeElement($venta)) {
  122.             // set the owning side to null (unless already changed)
  123.             if ($venta->getMesa() === $this) {
  124.                 $venta->setMesa(null);
  125.             }
  126.         }
  127.         return $this;
  128.     }
  129.     public function getPagado(): ?string
  130.     {
  131.         return $this->pagado;
  132.     }
  133.     public function setPagado(?string $pagado): self
  134.     {
  135.         $this->pagado $pagado;
  136.         return $this;
  137.     }
  138.     public function getPorPagar(): ?string
  139.     {
  140.         return $this->por_pagar;
  141.     }
  142.     public function setPorPagar(string $por_pagar): self
  143.     {
  144.         $this->por_pagar $por_pagar;
  145.         return $this;
  146.     }
  147.     /**
  148.      * @return Collection<int, Pedidos>
  149.      */
  150.     public function getPedidos(): Collection
  151.     {
  152.         return $this->pedidos;
  153.     }
  154.     public function addPedido(Pedidos $pedido): self
  155.     {
  156.         if (!$this->pedidos->contains($pedido)) {
  157.             $this->pedidos[] = $pedido;
  158.             $pedido->setMesa($this);
  159.         }
  160.         return $this;
  161.     }
  162.     public function removePedido(Pedidos $pedido): self
  163.     {
  164.         if ($this->pedidos->removeElement($pedido)) {
  165.             // set the owning side to null (unless already changed)
  166.             if ($pedido->getMesa() === $this) {
  167.                 $pedido->setMesa(null);
  168.             }
  169.         }
  170.         return $this;
  171.     }
  172.     public function getUnionMesas(): ?array
  173.     {
  174.         return $this->union_mesas;
  175.     }
  176.     public function setUnionMesas(?array $union_mesas): self
  177.     {
  178.         $this->union_mesas $union_mesas;
  179.         return $this;
  180.     }
  181.     public function getLocalizacion(): ?string
  182.     {
  183.         return $this->localizacion;
  184.     }
  185.     public function setLocalizacion(string $localizacion): self
  186.     {
  187.         $this->localizacion $localizacion;
  188.         return $this;
  189.     }
  190.     public function getZonas(): ?Zonas
  191.     {
  192.         return $this->zonas;
  193.     }
  194.     public function setZonas(?Zonas $zonas): self
  195.     {
  196.         $this->zonas $zonas;
  197.         return $this;
  198.     }
  199.     public function getComensales(): ?int
  200.     {
  201.         return $this->comensales;
  202.     }
  203.     public function setComensales(?int $comensales): self
  204.     {
  205.         $this->comensales $comensales;
  206.         return $this;
  207.     }
  208.     public function isFactura(): ?bool
  209.     {
  210.         return $this->factura;
  211.     }
  212.     public function setFactura(?bool $factura): self
  213.     {
  214.         $this->factura $factura;
  215.         return $this;
  216.     }
  217.     /**
  218.      * @return Collection<int, Tickets>
  219.      */
  220.     public function getTickets(): Collection
  221.     {
  222.         return $this->tickets;
  223.     }
  224.     public function addTicket(Tickets $ticket): self
  225.     {
  226.         if (!$this->tickets->contains($ticket)) {
  227.             $this->tickets[] = $ticket;
  228.             $ticket->setMesaid($this);
  229.         }
  230.         return $this;
  231.     }
  232.     public function removeTicket(Tickets $ticket): self
  233.     {
  234.         if ($this->tickets->removeElement($ticket)) {
  235.             // set the owning side to null (unless already changed)
  236.             if ($ticket->getMesaid() === $this) {
  237.                 $ticket->setMesaid(null);
  238.             }
  239.         }
  240.         return $this;
  241.     }
  242.     public function getCoordX(): ?float
  243.     {
  244.         return $this->coord_x;
  245.     }
  246.     public function setCoordX(?float $coord_x): self
  247.     {
  248.         $this->coord_x $coord_x;
  249.         return $this;
  250.     }
  251.     public function getCoordY(): ?float
  252.     {
  253.         return $this->coord_y;
  254.     }
  255.     public function setCoordY(?float $coord_y): self
  256.     {
  257.         $this->coord_y $coord_y;
  258.         return $this;
  259.     }
  260.     public function getIcon(): ?string
  261.     {
  262.         return $this->icon;
  263.     }
  264.     public function setIcon(?string $icon): self
  265.     {
  266.         $this->icon $icon;
  267.         return $this;
  268.     }
  269.     /**
  270.      * @return Collection<int, Statscomida>
  271.      */
  272.     public function getStatscomidas(): Collection
  273.     {
  274.         return $this->statscomidas;
  275.     }
  276.     public function addStatscomida(Statscomida $statscomida): self
  277.     {
  278.         if (!$this->statscomidas->contains($statscomida)) {
  279.             $this->statscomidas[] = $statscomida;
  280.             $statscomida->setMesa($this);
  281.         }
  282.         return $this;
  283.     }
  284.     public function removeStatscomida(Statscomida $statscomida): self
  285.     {
  286.         if ($this->statscomidas->removeElement($statscomida)) {
  287.             // set the owning side to null (unless already changed)
  288.             if ($statscomida->getMesa() === $this) {
  289.                 $statscomida->setMesa(null);
  290.             }
  291.         }
  292.         return $this;
  293.     }
  294.     /**
  295.      * @return Collection<int, Statscomensales>
  296.      */
  297.     public function getStatscomensales(): Collection
  298.     {
  299.         return $this->statscomensales;
  300.     }
  301.     public function addStatscomensale(Statscomensales $statscomensale): self
  302.     {
  303.         if (!$this->statscomensales->contains($statscomensale)) {
  304.             $this->statscomensales[] = $statscomensale;
  305.             $statscomensale->setMesa($this);
  306.         }
  307.         return $this;
  308.     }
  309.     public function removeStatscomensale(Statscomensales $statscomensale): self
  310.     {
  311.         if ($this->statscomensales->removeElement($statscomensale)) {
  312.             // set the owning side to null (unless already changed)
  313.             if ($statscomensale->getMesa() === $this) {
  314.                 $statscomensale->setMesa(null);
  315.             }
  316.         }
  317.         return $this;
  318.     }
  319. }