1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 14:16:39 +02:00

* added dibi::date & dibi::datetime

* DibiConnection::insertId && affectedRows throws exception on failure
* added protected throwException() to drivers
* DibiPostgreDriver - can build connection string
* DibiSqliteDriver - support for parameters 'format:date' & 'format:datetime'
* fixed query errors in DibiSqliteDriver
* DibiConnection prevents serialization and multiple transactions
This commit is contained in:
David Grudl
2007-11-23 23:27:14 +00:00
parent 3f42b2cf55
commit 7c6947a019
18 changed files with 419 additions and 176 deletions

View File

@@ -46,6 +46,13 @@ class DibiDriverException extends DibiException
private $sql;
/**
* Construct an dibi driver exception
*
* @param string Message describing the exception
* @param int Some code
* @param string SQL command
*/
public function __construct($message = NULL, $code = 0, $sql = NULL)
{
parent::__construct($message, (int) $code);
@@ -55,6 +62,9 @@ class DibiDriverException extends DibiException
/**
* @return string The SQL passed to the constructor
*/
final public function getSql()
{
return $this->sql;
@@ -62,9 +72,22 @@ class DibiDriverException extends DibiException
/**
* @return string string represenation of exception with SQL command
*/
public function __toString()
{
return parent::__toString() . ($this->sql ? "\nSQL: " . $this->sql : '');
}
/**
* @see NException::catchError (this is Late static binding fix
*/
public static function catchError($class = __CLASS__)
{
parent::catchError($class);
}
}