add delete() function -- mostly for completeness with insert(), update(), etc

This commit is contained in:
Sergey Tsalkov
2011-04-22 23:15:14 -04:00
parent 2985815750
commit 68774532e1
2 changed files with 27 additions and 0 deletions

View File

@@ -172,6 +172,15 @@ class DB
return DB::insertOrReplace('REPLACE', $table, $data);
}
public static function delete() {
$args = func_get_args();
$table = self::formatTableName(array_shift($args));
$where = array_shift($args);
$buildquery = "DELETE FROM $table WHERE $where";
array_unshift($args, $buildquery);
call_user_func_array('DB::queryNull', $args);
}
public static function sqleval($text) {
return new MeekroDBEval($text);
}