Commit 816d3117 authored by screeper's avatar screeper

Added update "column = !column"

Useful for changing booleans in DB.
Update like this:

...
$db->update("table", array("col_boolean" => $db->not()));
parent bc5116f8
......@@ -477,6 +477,10 @@ class MysqliDb
}
}
break;
case '[N]':
if($val == null) $this->_query .= "!" . $column . ", ";
else $this->_query .= "!" . $val . ", ";
break;
default:
die ("Wrong operation");
}
......@@ -754,6 +758,14 @@ class MysqliDb
return Array ("[I]" => "-" . (int)$num);
}
/**
* Method generates change boolean function call
* @param string column name. null by default
*/
public function not ($col = null) {
return Array ("[N]" => (string)$col);
}
/**
* Method generates user defined function call
* @param string user function body
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment