mirror of
https://github.com/dg/dibi.git
synced 2025-08-15 10:34:06 +02:00
* update DibiVariableInterface
* some bugs fixed
This commit is contained in:
@@ -65,8 +65,8 @@ class DibiMySqliDriver extends NObject implements DibiDriverInterface
|
||||
/**
|
||||
* Connects to a database
|
||||
*
|
||||
* @throws DibiException
|
||||
* @return void
|
||||
* @throws DibiException
|
||||
*/
|
||||
public function connect(array &$config)
|
||||
{
|
||||
@@ -208,6 +208,7 @@ class DibiMySqliDriver 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)
|
||||
{
|
||||
@@ -216,7 +217,7 @@ class DibiMySqliDriver 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');
|
||||
}
|
||||
|
||||
|
||||
@@ -283,7 +284,7 @@ class DibiMySqliDriver extends NObject implements DibiDriverInterface
|
||||
throw new BadMethodCallException(__METHOD__ . ' is not allowed for unbuffered queries');
|
||||
}
|
||||
if (!mysqli_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