mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 14:16:39 +02:00
* update DibiVariableInterface
* some bugs fixed
This commit is contained in:
@@ -54,8 +54,8 @@ class DibiMsSqlDriver extends NObject implements DibiDriverInterface
|
||||
/**
|
||||
* Connects to a database
|
||||
*
|
||||
* @throws DibiException
|
||||
* @return void
|
||||
* @throws DibiException
|
||||
*/
|
||||
public function connect(array &$config)
|
||||
{
|
||||
@@ -180,6 +180,7 @@ class DibiMsSqlDriver extends NObject implements DibiDriverInterface
|
||||
* @param string value
|
||||
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, dibi::FIELD_DATE, dibi::FIELD_DATETIME, dibi::IDENTIFIER)
|
||||
* @return string formatted value
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function format($value, $type)
|
||||
{
|
||||
@@ -188,7 +189,7 @@ class DibiMsSqlDriver extends NObject implements DibiDriverInterface
|
||||
if ($type === dibi::FIELD_BOOL) return $value ? -1 : 0;
|
||||
if ($type === dibi::FIELD_DATE) return date("'Y-m-d'", $value);
|
||||
if ($type === dibi::FIELD_DATETIME) return date("'Y-m-d H:i:s'", $value);
|
||||
throw new DibiException('Invalid formatting type');
|
||||
throw new InvalidArgumentException('Unsupported formatting type');
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +252,7 @@ class DibiMsSqlDriver extends NObject implements DibiDriverInterface
|
||||
public function seek($row)
|
||||
{
|
||||
if (!mssql_data_seek($this->resultset, $row)) {
|
||||
throw new DibiDriverException('Unable to seek to row ' . $row);
|
||||
throw new DibiDatabaseException('Unable to seek to row ' . $row);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user