Exemplo n.º 1
0
 function delete() {
     Recipe::requirePermission("DELETE");
     $query = "DELETE FROM recipe WHERE id=".Database::sqlValue($this->id);
     Database::query($query);
     $this->deletePhoto();
 }
Exemplo n.º 2
0
 function update() {
     Recipe::requirePermission("ADD");
     $this->last_update_date = time();
     $query = "UPDATE rating SET value=".Database::sqlValue($this->value);
     $query .= ", comment=".Database::sqlValue($this->comment);
     $query .= ", last_update_date=FROM_UNIXTIME(".Database::sqlValue($this->last_update_date).")";
     $query .= " WHERE id=".Database::sqlValue($this->id);
     Database::query($query);
     //print $query."<p>";
 }