initial commit
This commit is contained in:
35
models/plato.php
Normal file
35
models/plato.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
require_once('../db.php');
|
||||
|
||||
class Plato
|
||||
{
|
||||
private $id;
|
||||
private $nombre;
|
||||
private $descripcion;
|
||||
private $imagen;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function get_id() { return $this->id; }
|
||||
public function set_id($id) { $this->id = $id; }
|
||||
public function get_nombre() { return $this->nombre; }
|
||||
public function set_nombre($nombre) { $this->nombre = $nombre; }
|
||||
public function get_descripcion() { return $this->descripcion; }
|
||||
public function set_descripcion($descripcion) { $this->descripcion = $descripcion; }
|
||||
public function get_imagen() { return $this->imagen; }
|
||||
public function set_imagen($imagen) { $this->imagen = $imagen; }
|
||||
|
||||
public function save()
|
||||
{
|
||||
$db = new DB();
|
||||
$result = $db->dml
|
||||
(
|
||||
"insert into plato (id, nombre, descripcion, imagen) values (?, ?, ?, ?)",
|
||||
$this->id, $this->nombre, $this->descripcion, $this->imagen
|
||||
);
|
||||
return $result > 0;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user