1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-22 13:43:12 +02:00

updated for Nette 2.0 beta: exceptions

This commit is contained in:
David Grudl
2011-07-01 07:58:27 +02:00
parent 508e8638e8
commit ac1f45b397
18 changed files with 90 additions and 93 deletions

View File

@@ -44,12 +44,12 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
/**
* @throws NotSupportedException
* @throws DibiNotSupportedException
*/
public function __construct()
{
if (!extension_loaded('pgsql')) {
throw new NotSupportedException("PHP extension 'pgsql' is not loaded.");
throw new DibiNotSupportedException("PHP extension 'pgsql' is not loaded.");
}
}
@@ -323,7 +323,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
$value = pg_escape_string($this->connection, $value);
} else {
$value = pg_escape_string($value);
}
}
$value = strtr($value, array( '%' => '\\\\%', '_' => '\\\\_'));
return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'");
@@ -578,7 +578,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
*/
public function getForeignKeys($table)
{
throw new NotImplementedException;
throw new DibiNotImplementedException;
}
}