Commit 1081ac1b by Franz Liedke

Implement DB::escape().

parent 4f8a6724
...@@ -126,6 +126,19 @@ class Database { ...@@ -126,6 +126,19 @@ class Database {
} }
/** /**
* Escape a string for usage in a query.
*
* This uses the correct quoting mechanism for the default database connection.
*
* @param string $value
* @return string
*/
public static function escape($value)
{
return static::connection()->pdo->quote($value);
}
/**
* Get the profiling data for all queries. * Get the profiling data for all queries.
* *
* @return array * @return array
......
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