Files
prueba-aplicaciones-web/models/pedido.php
Daniel Cortés f480b2942f initial commit
2019-12-12 16:05:20 -03:00

39 lines
1.1 KiB
PHP

<?php
require_once('../db.php');
class Reserva
{
private $id;
private $fecha;
private $estado;
private $plato_id;
private $cliente_id;
public function __construct()
{
}
public function get_id() { return $this->id; }
public function get_fecha() { return $this->fecha; }
public function get_estado() { return $this->estado; }
public function get_plato_id() { return $this->plato_id; }
public function get_cliente_id() { return $this->cliente_id; }
public function set_id($id) { $this->id = $id}
public function set_fecha($fecha) { $this->fecha = $fecha; }
public function set_estado($estado) { $this->estado = $estado; }
public function set_plato_id($plato_id) { $this->plato_id = $plato_id; }
public function set_cliente_id($cliente_id) { $this->cliente_id = $cliente_id; }
public function save()
{
$db = new DB();
$result = $db->dml
(
"insert into plato (id, fecha, estado, plato, cliente) values (?, ?, ?, ?, ?)",
$this->id, $this->fecha, $this->estado, $this->plato_id, $this->cliente_id
);
return $result > 0;
}
}
?>