Commit 1081ac1b authored by Franz Liedke's avatar Franz Liedke

Implement DB::escape().

parent 4f8a6724
...@@ -125,6 +125,19 @@ class Database { ...@@ -125,6 +125,19 @@ class Database {
return new Expression($value); return new Expression($value);
} }
/**
* 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.
* *
......
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