mirror of
https://github.com/dg/dibi.git
synced 2025-02-24 10:53:17 +01:00
Merge pull request #34 from mil0/master.
implemented escapeLike() for PostgreSQL driver
This commit is contained in:
commit
508e8638e8
@ -319,7 +319,14 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
|
|||||||
*/
|
*/
|
||||||
public function escapeLike($value, $pos)
|
public function escapeLike($value, $pos)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException;
|
if ($this->escMethod) {
|
||||||
|
$value = pg_escape_string($this->connection, $value);
|
||||||
|
} else {
|
||||||
|
$value = pg_escape_string($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
$value = strtr($value, array( '%' => '\\\\%', '_' => '\\\\_'));
|
||||||
|
return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user