mirror of
https://github.com/dg/dibi.git
synced 2025-08-12 17:14:16 +02:00
IDibiDriver splitted into IDibiDriver & IDibiResultDriver
This commit is contained in:
@@ -349,7 +349,7 @@ class DibiTableInfo extends DibiObject
|
||||
*/
|
||||
class DibiResultInfo extends DibiObject
|
||||
{
|
||||
/** @var IDibiReflector */
|
||||
/** @var IDibiResultDriver */
|
||||
private $driver;
|
||||
|
||||
/** @var array */
|
||||
@@ -360,7 +360,7 @@ class DibiResultInfo extends DibiObject
|
||||
|
||||
|
||||
|
||||
public function __construct(IDibiReflector $driver)
|
||||
public function __construct(IDibiResultDriver $driver)
|
||||
{
|
||||
$this->driver = $driver;
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@
|
||||
* @package dibi
|
||||
*
|
||||
* @property-read mixed $resource
|
||||
* @property-read IDibiDriver $driver
|
||||
* @property-read IDibiResultDriver $driver
|
||||
* @property-read int $rowCount
|
||||
* @property-read DibiResultIterator $iterator
|
||||
* @property string $rowClass
|
||||
@@ -40,7 +40,7 @@
|
||||
*/
|
||||
class DibiResult extends DibiObject implements IDataSource
|
||||
{
|
||||
/** @var array IDibiDriver */
|
||||
/** @var array IDibiResultDriver */
|
||||
private $driver;
|
||||
|
||||
/** @var array Translate table */
|
||||
@@ -61,7 +61,7 @@ class DibiResult extends DibiObject implements IDataSource
|
||||
|
||||
|
||||
/**
|
||||
* @param IDibiDriver
|
||||
* @param IDibiResultDriver
|
||||
* @param array
|
||||
*/
|
||||
public function __construct($driver, $config)
|
||||
@@ -106,7 +106,7 @@ class DibiResult extends DibiObject implements IDataSource
|
||||
|
||||
/**
|
||||
* Safe access to property $driver.
|
||||
* @return IDibiDriver
|
||||
* @return IDibiResultDriver
|
||||
* @throws InvalidStateException
|
||||
*/
|
||||
private function getDriver()
|
||||
|
@@ -104,7 +104,7 @@ interface IDibiDriver
|
||||
/**
|
||||
* Internal: Executes the SQL query.
|
||||
* @param string SQL statement.
|
||||
* @return IDibiDriver|NULL
|
||||
* @return IDibiResultDriver|NULL
|
||||
* @throws DibiDriverException
|
||||
*/
|
||||
function query($sql);
|
||||
@@ -151,12 +151,6 @@ interface IDibiDriver
|
||||
*/
|
||||
function getResource();
|
||||
|
||||
|
||||
|
||||
/********************* SQL ****************d*g**/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Encodes data for use in a SQL statement.
|
||||
* @param string value
|
||||
@@ -166,15 +160,6 @@ interface IDibiDriver
|
||||
*/
|
||||
function escape($value, $type);
|
||||
|
||||
/**
|
||||
* Decodes data from result set.
|
||||
* @param string value
|
||||
* @param string type (dibi::BINARY)
|
||||
* @return string decoded value
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
function unescape($value, $type);
|
||||
|
||||
/**
|
||||
* Injects LIMIT/OFFSET to the SQL query.
|
||||
* @param string &$sql The SQL query that will be modified.
|
||||
@@ -184,12 +169,21 @@ interface IDibiDriver
|
||||
*/
|
||||
function applyLimit(&$sql, $limit, $offset);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/********************* result set ****************d*g**/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* dibi result set driver interface.
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
interface IDibiResultDriver
|
||||
{
|
||||
|
||||
/**
|
||||
* Returns the number of rows in a result set.
|
||||
* @return int
|
||||
@@ -230,6 +224,16 @@ interface IDibiDriver
|
||||
* @return mixed
|
||||
*/
|
||||
function getResultResource();
|
||||
|
||||
/**
|
||||
* Decodes data from result set.
|
||||
* @param string value
|
||||
* @param string type (dibi::BINARY)
|
||||
* @return string decoded value
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
function unescape($value, $type);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user