src/Entity/Pedidos.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PedidosRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=PedidosRepository::class)
  9.  */
  10. class Pedidos
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=Mesas::class, inversedBy="pedidos")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $mesa;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Comida::class, inversedBy="pedidos")
  25.      * @ORM\JoinColumn(nullable=true)
  26.      */
  27.     private $comida;
  28.     /**
  29.      * @ORM\Column(type="string", length=255, nullable=true)
  30.      */
  31.     private $comentarios;
  32.     /**
  33.      * @ORM\Column(type="boolean", nullable=true)
  34.      */
  35.     private $marchando;
  36.     /**
  37.      * @ORM\Column(type="simple_array", nullable=true)
  38.      */
  39.     private $extras = [];
  40.     /**
  41.      * @ORM\Column(type="boolean", nullable=true)
  42.      */
  43.     private $invitacion;
  44.     /**
  45.      * @ORM\Column(type="float", nullable=true)
  46.      */
  47.     private $descuento;
  48.     /**
  49.      * @ORM\Column(type="float", nullable=true)
  50.      */
  51.     private $descuento_eur;
  52.     /**
  53.      * @ORM\Column(type="integer", nullable=true)
  54.      */
  55.     private $estado 0;
  56.     /**
  57.      * @ORM\OneToMany(targetEntity=Tickets::class, mappedBy="pedido")
  58.      */
  59.     private $tickets;
  60.     /**
  61.      * @ORM\Column(type="integer", nullable=true)
  62.      */
  63.     private $num_plato;
  64.     /**
  65.      * @ORM\Column(type="string", nullable=true)
  66.      */
  67.     private $num_ref;
  68.     /**
  69.      * @ORM\ManyToOne(targetEntity=Productostienda::class, inversedBy="pedidos")
  70.      */
  71.     private $producttienda;
  72.     /**
  73.      * @ORM\Column(type="boolean", nullable=true)
  74.      */
  75.     private $entregado false;
  76.     public function __construct()
  77.     {
  78.         $this->tickets = new ArrayCollection();
  79.     }
  80.     public function getId(): ?int
  81.     {
  82.         return $this->id;
  83.     }
  84.     public function getMesa(): ?Mesas
  85.     {
  86.         return $this->mesa;
  87.     }
  88.     public function setMesa(?Mesas $mesa): self
  89.     {
  90.         $this->mesa $mesa;
  91.         return $this;
  92.     }
  93.     public function getComida(): ?Comida
  94.     {
  95.         return $this->comida;
  96.     }
  97.     public function setComida(?Comida $comida): self
  98.     {
  99.         $this->comida $comida;
  100.         return $this;
  101.     }
  102.     public function getComentarios(): ?string
  103.     {
  104.         return $this->comentarios;
  105.     }
  106.     public function setComentarios(?string $comentarios): self
  107.     {
  108.         $this->comentarios $comentarios;
  109.         return $this;
  110.     }
  111.     public function isMarchando(): ?bool
  112.     {
  113.         return $this->marchando;
  114.     }
  115.     public function setMarchando(?bool $marchando): self
  116.     {
  117.         $this->marchando $marchando;
  118.         return $this;
  119.     }
  120.     public function getExtras(): ?array
  121.     {
  122.         return $this->extras;
  123.     }
  124.     public function setExtras(?array $extras): self
  125.     {
  126.         $this->extras $extras;
  127.         return $this;
  128.     }
  129.     public function isInvitacion(): ?bool
  130.     {
  131.         return $this->invitacion;
  132.     }
  133.     public function setInvitacion(?bool $invitacion): self
  134.     {
  135.         $this->invitacion $invitacion;
  136.         return $this;
  137.     }
  138.     public function getDescuento(): ?float
  139.     {
  140.         return $this->descuento;
  141.     }
  142.     public function setDescuento(?float $descuento): self
  143.     {
  144.         $this->descuento $descuento;
  145.         return $this;
  146.     }
  147.     public function getDescuentoEur(): ?float
  148.     {
  149.         return $this->descuento_eur;
  150.     }
  151.     public function setDescuentoEur(?float $descuento_eur): self
  152.     {
  153.         $this->descuento_eur $descuento_eur;
  154.         return $this;
  155.     }
  156.     public function getEstado(): ?int
  157.     {
  158.         return $this->estado;
  159.     }
  160.     public function setEstado(?int $estado): self
  161.     {
  162.         $this->estado $estado;
  163.         return $this;
  164.     }
  165.     /**
  166.      * @return Collection<int, Tickets>
  167.      */
  168.     public function getTickets(): Collection
  169.     {
  170.         return $this->tickets;
  171.     }
  172.     public function addTicket(Tickets $ticket): self
  173.     {
  174.         if (!$this->tickets->contains($ticket)) {
  175.             $this->tickets[] = $ticket;
  176.             $ticket->setPedido($this);
  177.         }
  178.         return $this;
  179.     }
  180.     public function removeTicket(Tickets $ticket): self
  181.     {
  182.         if ($this->tickets->removeElement($ticket)) {
  183.             // set the owning side to null (unless already changed)
  184.             if ($ticket->getPedido() === $this) {
  185.                 $ticket->setPedido(null);
  186.             }
  187.         }
  188.         return $this;
  189.     }
  190.     public function getNumPlato(): ?int
  191.     {
  192.         return $this->num_plato;
  193.     }
  194.     public function setNumPlato(?int $num_plato): self
  195.     {
  196.         $this->num_plato $num_plato;
  197.         return $this;
  198.     }
  199.     public function getNumRef(): ?string
  200.     {
  201.         return $this->num_ref;
  202.     }
  203.     public function setNumRef(?string $num_ref): self
  204.     {
  205.         $this->num_ref $num_ref;
  206.         return $this;
  207.     }
  208.     public function getProducttienda(): ?ProductosTienda
  209.     {
  210.         return $this->producttienda;
  211.     }
  212.     public function setProducttienda(?ProductosTienda $producttienda): self
  213.     {
  214.         $this->producttienda $producttienda;
  215.         return $this;
  216.     }
  217.     public function isEntregado(): ?bool
  218.     {
  219.         return $this->entregado;
  220.     }
  221.     public function setEntregado(?bool $entregado): self
  222.     {
  223.         $this->entregado $entregado;
  224.         return $this;
  225.     }
  226. }