1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-04 13:17:58 +02:00

Firebird: Add escapeLike() (#300,#305)

This commit is contained in:
jan-oliva
2018-07-14 16:38:50 +02:00
committed by David Grudl
parent eaf2494d90
commit fe0e7510af

View File

@@ -276,7 +276,8 @@ class FirebirdDriver implements Dibi\Driver
*/
public function escapeLike(string $value, int $pos): string
{
throw new Dibi\NotImplementedException;
$value = addcslashes($this->escapeText($value), '%_\\');
return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'") . " ESCAPE '\\'";
}