src/Entity/Comida.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ComidaRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ComidaRepository::class)
  9.  */
  10. class Comida
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=50)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=200, nullable=true)
  24.      */
  25.     private $description;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=TipoComida::class, inversedBy="comida")
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $type_food;
  31.     /**
  32.      * @ORM\OneToMany(targetEntity=Pedidos::class, mappedBy="comida")
  33.      */
  34.     private $pedidos;
  35.     /**
  36.      * @ORM\Column(type="decimal", precision=10, scale=2)
  37.      */
  38.     private $precio;
  39.     /**
  40.      * @ORM\Column(type="boolean", nullable=true)
  41.      */
  42.     private $unitario;
  43.     /**
  44.      * @ORM\OneToMany(targetEntity=Stock::class, mappedBy="comida")
  45.      */
  46.     private $stock;
  47.     /**
  48.      * @ORM\Column(type="boolean", nullable=true)
  49.      */
  50.     private $iscomida;
  51.     /**
  52.      * @ORM\Column(type="boolean", nullable=true)
  53.      */
  54.     private $isbebida;
  55.     /**
  56.      * @ORM\Column(type="boolean", nullable=true)
  57.      */
  58.     private $extra;
  59.     /**
  60.      * @ORM\Column(type="simple_array", nullable=true)
  61.      */
  62.     private $posiblesextras = [];
  63.     /**
  64.      * @ORM\Column(type="integer", nullable=true)
  65.      */
  66.     private $num_plato 1;
  67.     /**
  68.      * @ORM\Column(type="integer", nullable=true)
  69.      */
  70.     private $numplato;
  71.     /**
  72.      * @ORM\OneToMany(targetEntity=Statscomida::class, mappedBy="comida")
  73.      */
  74.     private $statscomidas;
  75.     /**
  76.      * @ORM\Column(type="string", length=250, nullable=true)
  77.      */
  78.     private $rutaimg;
  79.     /**
  80.      * @ORM\Column(type="boolean")
  81.      */
  82.     private $is_deleted;
  83.     public function __construct()
  84.     {
  85.         $this->pedidos = new ArrayCollection();
  86.         $this->statscomidas = new ArrayCollection();
  87.     }
  88.     public function getId(): ?int
  89.     {
  90.         return $this->id;
  91.     }
  92.     public function getName(): ?string
  93.     {
  94.         return $this->name;
  95.     }
  96.     public function setName(string $name): self
  97.     {
  98.         $this->name $name;
  99.         return $this;
  100.     }
  101.     public function getDescription(): ?string
  102.     {
  103.         return $this->description;
  104.     }
  105.     public function setDescription(?string $description): self
  106.     {
  107.         $this->description $description;
  108.         return $this;
  109.     }
  110.     public function getTypeFood(): ?TipoComida
  111.     {
  112.         return $this->type_food;
  113.     }
  114.     public function setTypeFood(?TipoComida $type_food): self
  115.     {
  116.         $this->type_food $type_food;
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return Collection<int, Pedidos>
  121.      */
  122.     public function getPedidos(): Collection
  123.     {
  124.         return $this->pedidos;
  125.     }
  126.     public function addPedido(Pedidos $pedido): self
  127.     {
  128.         if (!$this->pedidos->contains($pedido)) {
  129.             $this->pedidos[] = $pedido;
  130.             $pedido->setComida($this);
  131.         }
  132.         return $this;
  133.     }
  134.     public function removePedido(Pedidos $pedido): self
  135.     {
  136.         if ($this->pedidos->removeElement($pedido)) {
  137.             // set the owning side to null (unless already changed)
  138.             if ($pedido->getComida() === $this) {
  139.                 $pedido->setComida(null);
  140.             }
  141.         }
  142.         return $this;
  143.     }
  144.     public function getPrecio(): ?string
  145.     {
  146.         return $this->precio;
  147.     }
  148.     public function setPrecio(float $precio): self
  149.     {
  150.         $this->precio $precio;
  151.         return $this;
  152.     }
  153.     public function isUnitario(): ?bool
  154.     {
  155.         return $this->unitario;
  156.     }
  157.     public function setUnitario(?bool $unitario): self
  158.     {
  159.         $this->unitario $unitario;
  160.         return $this;
  161.     }
  162.     public function getStock(): ?Stock
  163.     {
  164.         return $this->stock;
  165.     }
  166.     public function setStock(?Stock $stock): self
  167.     {
  168.         // unset the owning side of the relation if necessary
  169.         if ($stock === null && $this->stock !== null) {
  170.             $this->stock->setComida(null);
  171.         }
  172.         // set the owning side of the relation if necessary
  173.         if ($stock !== null && $stock->getComida() !== $this) {
  174.             $stock->setComida($this);
  175.         }
  176.         $this->stock $stock;
  177.         return $this;
  178.     }
  179.     public function isIscomida(): ?bool
  180.     {
  181.         return $this->iscomida;
  182.     }
  183.     public function setIscomida(?bool $iscomida): self
  184.     {
  185.         $this->iscomida $iscomida;
  186.         return $this;
  187.     }
  188.     public function isIsbebida(): ?bool
  189.     {
  190.         return $this->isbebida;
  191.     }
  192.     public function setIsbebida(?bool $iscomida): self
  193.     {
  194.         $this->isbebida $iscomida;
  195.         return $this;
  196.     }
  197.     public function isExtra(): ?bool
  198.     {
  199.         return $this->extra;
  200.     }
  201.     public function setExtra(?bool $extra): self
  202.     {
  203.         $this->extra $extra;
  204.         return $this;
  205.     }
  206.     public function getPosiblesextras(): ?array
  207.     {
  208.         return $this->posiblesextras;
  209.     }
  210.     public function setPosiblesextras(?array $posiblesextras): self
  211.     {
  212.         $this->posiblesextras $posiblesextras;
  213.         return $this;
  214.     }
  215.     public function getNumPlato(): ?int
  216.     {
  217.         return $this->num_plato;
  218.     }
  219.     public function setNumPlato(?int $num_plato): self
  220.     {
  221.         $this->num_plato $num_plato;
  222.         return $this;
  223.     }
  224.     /**
  225.      * @return Collection<int, Statscomida>
  226.      */
  227.     public function getStatscomidas(): Collection
  228.     {
  229.         return $this->statscomidas;
  230.     }
  231.     public function addStatscomida(Statscomida $statscomida): self
  232.     {
  233.         if (!$this->statscomidas->contains($statscomida)) {
  234.             $this->statscomidas[] = $statscomida;
  235.             $statscomida->setComida($this);
  236.         }
  237.         return $this;
  238.     }
  239.     public function removeStatscomida(Statscomida $statscomida): self
  240.     {
  241.         if ($this->statscomidas->removeElement($statscomida)) {
  242.             // set the owning side to null (unless already changed)
  243.             if ($statscomida->getComida() === $this) {
  244.                 $statscomida->setComida(null);
  245.             }
  246.         }
  247.         return $this;
  248.     }
  249.     public function getRutaimg(): ?string
  250.     {
  251.         return $this->rutaimg;
  252.     }
  253.     public function setRutaimg(?string $rutaimg): self
  254.     {
  255.         $this->rutaimg $rutaimg;
  256.         return $this;
  257.     }
  258.     public function isIsDeleted(): ?bool
  259.     {
  260.         return $this->is_deleted;
  261.     }
  262.     public function setIsDeleted(bool $is_deleted): self
  263.     {
  264.         $this->is_deleted $is_deleted;
  265.         return $this;
  266.     }
  267. }