1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-04 13:17:58 +02:00

- phpDoc simplified

This commit is contained in:
David Grudl
2008-10-28 15:24:47 +00:00
parent 7565ffb1d4
commit a2d0d66d0f
16 changed files with 98 additions and 423 deletions

View File

@@ -90,100 +90,68 @@ require_once dirname(__FILE__) . '/libs/DibiProfiler.php';
*/
class dibi
{
/**
* Column type in relation to PHP native type.
/**#@+
* dibi column type
*/
const
FIELD_TEXT = 's', // as 'string'
FIELD_BINARY = 'bin',
FIELD_BOOL = 'b',
FIELD_INTEGER = 'i',
FIELD_FLOAT = 'f',
FIELD_DATE = 'd',
FIELD_DATETIME = 't',
FIELD_TIME = 't',
// special
IDENTIFIER = 'n';
const FIELD_TEXT = 's'; // as 'string'
const FIELD_BINARY = 'bin';
const FIELD_BOOL = 'b';
const FIELD_INTEGER = 'i';
const FIELD_FLOAT = 'f';
const FIELD_DATE = 'd';
const FIELD_DATETIME = 't';
const FIELD_TIME = 't';
/**#@-*/
/**
* Identifier type
*/
const IDENTIFIER = 'n';
/**#@+
* dibi version
*/
const
VERSION = '0.9',
REVISION = '$WCREV$ released on $WCDATE$';
const VERSION = '0.9';
const REVISION = '$WCREV$ released on $WCDATE$';
/**#@-*/
/**
* Configuration options
*/
const
RESULT_WITH_TABLES = 'resultWithTables'; // for MySQL
const RESULT_WITH_TABLES = 'resultWithTables'; // for MySQL
/**
* Connection registry storage for DibiConnection objects.
* @var DibiConnection[]
*/
/** @var DibiConnection[] Connection registry storage for DibiConnection objects */
private static $registry = array();
/**
* Current connection.
* @var DibiConnection
*/
/** @var DibiConnection Current connection */
private static $connection;
/**
* Substitutions for identifiers.
* @var array
*/
/** @var array Substitutions for identifiers */
private static $substs = array();
/**
* Substitution fallback.
* @var callback
*/
/** @var callback Substitution fallback */
private static $substFallBack;
/**
* @see addHandler
* @var array
*/
/** @var array @see addHandler */
private static $handlers = array();
/**
* Last SQL command @see dibi::query()
* @var string
*/
/** @var string Last SQL command @see dibi::query() */
public static $sql;
/**
* Elapsed time for last query.
* @var int
*/
/** @var int Elapsed time for last query */
public static $elapsedTime;
/**
* Elapsed time for all queries.
* @var int
*/
/** @var int Elapsed time for all queries */
public static $totalTime;
/**
* Number or queries.
* @var int
*/
/** @var int Number or queries */
public static $numOfQueries = 0;
/**
* Default dibi driver.
* @var string
*/
/** @var string Default dibi driver */
public static $defaultDriver = 'mysql';
/**
* Static class - cannot be instantiated.
*/
@@ -200,7 +168,6 @@ class dibi
/**
* Creates a new DibiConnection object and connects it to specified database.
*
* @param array|string|ArrayObject connection parameters
* @param string connection name
* @return DibiConnection
@@ -215,7 +182,6 @@ class dibi
/**
* Disconnects from database (doesn't destroy DibiConnection object).
*
* @return void
*/
public static function disconnect()
@@ -227,7 +193,6 @@ class dibi
/**
* Returns TRUE when connection was established.
*
* @return bool
*/
public static function isConnected()
@@ -239,7 +204,6 @@ class dibi
/**
* Retrieve active connection.
*
* @param string connection registy name
* @return DibiConnection
* @throws DibiException
@@ -265,7 +229,6 @@ class dibi
/**
* Change active connection.
*
* @param string connection registy name
* @return void
* @throws DibiException
@@ -295,7 +258,6 @@ class dibi
/**
* Generates and executes SQL query - Monostate for DibiConnection::query().
*
* @param array|mixed one or more arguments
* @return DibiResult|NULL result set object (if any)
* @throws DibiException
@@ -310,7 +272,6 @@ class dibi
/**
* Executes the SQL query - Monostate for DibiConnection::nativeQuery().
*
* @param string SQL statement.
* @return DibiResult|NULL result set object (if any)
*/
@@ -323,7 +284,6 @@ class dibi
/**
* Generates and prints SQL query - Monostate for DibiConnection::test().
*
* @param array|mixed one or more arguments
* @return bool
*/
@@ -337,7 +297,6 @@ class dibi
/**
* Executes SQL query and fetch result - Monostate for DibiConnection::query() & fetch().
*
* @param array|mixed one or more arguments
* @return DibiRow
* @throws DibiException
@@ -352,7 +311,6 @@ class dibi
/**
* Executes SQL query and fetch results - Monostate for DibiConnection::query() & fetchAll().
*
* @param array|mixed one or more arguments
* @return array of DibiRow
* @throws DibiException
@@ -367,7 +325,6 @@ class dibi
/**
* Executes SQL query and fetch first column - Monostate for DibiConnection::query() & fetchSingle().
*
* @param array|mixed one or more arguments
* @return string
* @throws DibiException
@@ -382,7 +339,6 @@ class dibi
/**
* Executes SQL query and fetch pairs - Monostate for DibiConnection::query() & fetchPairs().
*
* @param array|mixed one or more arguments
* @return string
* @throws DibiException
@@ -398,7 +354,6 @@ class dibi
/**
* Gets the number of affected rows.
* Monostate for DibiConnection::affectedRows()
*
* @return int number of rows
* @throws DibiException
*/
@@ -412,7 +367,6 @@ class dibi
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
* Monostate for DibiConnection::insertId()
*
* @param string optional sequence name
* @return int
* @throws DibiException
@@ -462,7 +416,6 @@ class dibi
/**
* Gets a information about the current database - Monostate for DibiConnection::getDatabaseInfo().
*
* @return DibiDatabaseInfo
*/
public static function getDatabaseInfo()
@@ -474,7 +427,6 @@ class dibi
/**
* Import SQL dump from file - extreme fast!
*
* @param string filename
* @return int count of sql commands
*/
@@ -565,7 +517,6 @@ class dibi
/**
* Pseudotype for timestamp representation.
*
* @param mixed datetime
* @return DibiVariable
*/
@@ -585,7 +536,6 @@ class dibi
/**
* Pseudotype for date representation.
*
* @param mixed date
* @return DibiVariable
*/
@@ -604,7 +554,6 @@ class dibi
/**
* Create a new substitution pair for indentifiers.
*
* @param string from
* @param string to
* @return void
@@ -618,7 +567,6 @@ class dibi
/**
* Sets substitution fallback handler.
*
* @param callback
* @return void
*/
@@ -635,7 +583,6 @@ class dibi
/**
* Remove substitution pair.
*
* @param mixed from or TRUE
* @return void
*/
@@ -652,7 +599,6 @@ class dibi
/**
* Provides substitution.
*
* @param string
* @return string
*/
@@ -670,7 +616,6 @@ class dibi
/**
* Substitution callback.
*
* @param array
* @return string
*/
@@ -696,7 +641,6 @@ class dibi
/**
* Prints out a syntax highlighted version of the SQL command or DibiResult.
*
* @param string|DibiResult
* @param bool return output instead of printing it?
* @return string

View File

@@ -37,17 +37,11 @@
class DibiMsSqlDriver extends DibiObject implements IDibiDriver
{
/**
* Connection resource.
* @var resource
*/
/** @var resource Connection resource */
private $connection;
/**
* Resultset resource.
* @var resource
*/
/** @var resource Resultset resource */
private $resultSet;
@@ -66,7 +60,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Connects to a database.
*
* @return void
* @throws DibiException
*/
@@ -95,7 +88,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Disconnects from a database.
*
* @return void
*/
public function disconnect()
@@ -107,7 +99,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Executes the SQL query.
*
* @param string SQL statement.
* @return IDibiDriver|NULL
* @throws DibiDriverException
@@ -127,7 +118,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
*
* @return int|FALSE number of rows or FALSE on error
*/
public function affectedRows()
@@ -139,7 +129,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
*
* @return int|FALSE int on success or FALSE on failure
*/
public function insertId($sequence)
@@ -187,7 +176,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Returns the connection resource.
*
* @return mixed
*/
public function getResource()
@@ -203,7 +191,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Encodes data for use in an SQL statement.
*
* @param string value
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
* @return string encoded value
@@ -239,7 +226,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Decodes data from result set.
*
* @param string value
* @param string type (dibi::FIELD_BINARY)
* @return string decoded value
@@ -254,7 +240,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Injects LIMIT/OFFSET to the SQL query.
*
* @param string &$sql The SQL query that will be modified.
* @param int $limit
* @param int $offset
@@ -280,7 +265,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Returns the number of rows in a result set.
*
* @return int
*/
public function rowCount()
@@ -292,10 +276,9 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Fetches the row at current position and moves the internal cursor to the next position.
* internal usage only
*
* @param bool TRUE for associative array, FALSE for numeric
* @return array array on success, nonarray if no next record
* @internal
*/
public function fetch($assoc)
{
@@ -306,7 +289,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Moves cursor position without fetching row.
*
* @param int the 0-based cursor pos to seek to
* @return boolean TRUE on success, FALSE if unable to seek to specified record
* @throws DibiException
@@ -320,7 +302,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Frees the resources allocated for this result set.
*
* @return void
*/
public function free()
@@ -333,7 +314,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Returns metadata for all columns in a result set.
*
* @return array
*/
public function getColumnsMeta()
@@ -356,7 +336,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
/**
* Returns the result set resource.
*
* @return mixed
*/
public function getResultResource()

View File

@@ -43,24 +43,15 @@
class DibiMySqlDriver extends DibiObject implements IDibiDriver
{
/**
* Connection resource.
* @var resource
*/
/** @var resource Connection resource */
private $connection;
/**
* Resultset resource.
* @var resource
*/
/** @var resource Resultset resource */
private $resultSet;
/**
* Is buffered (seekable and countable)?
* @var bool
*/
/** @var bool Is buffered (seekable and countable)? */
private $buffered;
@@ -79,7 +70,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Connects to a database.
*
* @return void
* @throws DibiException
*/
@@ -153,7 +143,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Disconnects from a database.
*
* @return void
*/
public function disconnect()
@@ -165,7 +154,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Executes the SQL query.
*
* @param string SQL statement.
* @return IDibiDriver|NULL
* @throws DibiDriverException
@@ -189,7 +177,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
*
* @return int|FALSE number of rows or FALSE on error
*/
public function affectedRows()
@@ -201,7 +188,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
*
* @return int|FALSE int on success or FALSE on failure
*/
public function insertId($sequence)
@@ -249,7 +235,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Returns the connection resource.
*
* @return mixed
*/
public function getResource()
@@ -265,7 +250,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Encodes data for use in an SQL statement.
*
* @param string value
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
* @return string encoded value
@@ -301,7 +285,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Decodes data from result set.
*
* @param string value
* @param string type (dibi::FIELD_BINARY)
* @return string decoded value
@@ -316,7 +299,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Injects LIMIT/OFFSET to the SQL query.
*
* @param string &$sql The SQL query that will be modified.
* @param int $limit
* @param int $offset
@@ -339,7 +321,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Returns the number of rows in a result set.
*
* @return int
*/
public function rowCount()
@@ -354,10 +335,9 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Fetches the row at current position and moves the internal cursor to the next position.
* internal usage only
*
* @param bool TRUE for associative array, FALSE for numeric
* @return array array on success, nonarray if no next record
* @internal
*/
public function fetch($assoc)
{
@@ -368,7 +348,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Moves cursor position without fetching row.
*
* @param int the 0-based cursor pos to seek to
* @return boolean TRUE on success, FALSE if unable to seek to specified record
* @throws DibiException
@@ -386,7 +365,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Frees the resources allocated for this result set.
*
* @return void
*/
public function free()
@@ -399,7 +377,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Returns metadata for all columns in a result set.
*
* @return array
*/
public function getColumnsMeta()
@@ -423,7 +400,6 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
/**
* Returns the result set resource.
*
* @return mixed
*/
public function getResultResource()

View File

@@ -43,24 +43,15 @@
class DibiMySqliDriver extends DibiObject implements IDibiDriver
{
/**
* Connection resource.
* @var mysqli
*/
/** @var mysqli Connection resource */
private $connection;
/**
* Resultset resource.
* @var mysqli_result
*/
/** @var mysqli_result Resultset resource */
private $resultSet;
/**
* Is buffered (seekable and countable)?
* @var bool
*/
/** @var bool Is buffered (seekable and countable)? */
private $buffered;
@@ -79,7 +70,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Connects to a database.
*
* @return void
* @throws DibiException
*/
@@ -141,7 +131,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Disconnects from a database.
*
* @return void
*/
public function disconnect()
@@ -153,7 +142,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Executes the SQL query.
*
* @param string SQL statement.
* @return IDibiDriver|NULL
* @throws DibiDriverException
@@ -173,7 +161,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
*
* @return int|FALSE number of rows or FALSE on error
*/
public function affectedRows()
@@ -185,7 +172,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
*
* @return int|FALSE int on success or FALSE on failure
*/
public function insertId($sequence)
@@ -233,7 +219,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Returns the connection resource.
*
* @return mysqli
*/
public function getResource()
@@ -249,7 +234,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Encodes data for use in an SQL statement.
*
* @param string value
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
* @return string encoded value
@@ -284,7 +268,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Decodes data from result set.
*
* @param string value
* @param string type (dibi::FIELD_BINARY)
* @return string decoded value
@@ -299,7 +282,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Injects LIMIT/OFFSET to the SQL query.
*
* @param string &$sql The SQL query that will be modified.
* @param int $limit
* @param int $offset
@@ -322,7 +304,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Returns the number of rows in a result set.
*
* @return int
*/
public function rowCount()
@@ -337,10 +318,9 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Fetches the row at current position and moves the internal cursor to the next position.
* internal usage only
*
* @param bool TRUE for associative array, FALSE for numeric
* @return array array on success, nonarray if no next record
* @internal
*/
public function fetch($assoc)
{
@@ -351,7 +331,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Moves cursor position without fetching row.
*
* @param int the 0-based cursor pos to seek to
* @return boolean TRUE on success, FALSE if unable to seek to specified record
* @throws DibiException
@@ -368,7 +347,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Frees the resources allocated for this result set.
*
* @return void
*/
public function free()
@@ -381,7 +359,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Returns metadata for all columns in a result set.
*
* @return array
*/
public function getColumnsMeta()
@@ -415,7 +392,6 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
/**
* Returns the result set resource.
*
* @return mysqli_result
*/
public function getResultResource()

View File

@@ -36,24 +36,15 @@
class DibiOdbcDriver extends DibiObject implements IDibiDriver
{
/**
* Connection resource.
* @var resource
*/
/** @var resource Connection resource */
private $connection;
/**
* Resultset resource.
* @var resource
*/
/** @var resource Resultset resource */
private $resultSet;
/**
* Cursor.
* @var int
*/
/** @var int Cursor */
private $row = 0;
@@ -72,7 +63,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Connects to a database.
*
* @return void
* @throws DibiException
*/
@@ -101,7 +91,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Disconnects from a database.
*
* @return void
*/
public function disconnect()
@@ -113,7 +102,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Executes the SQL query.
*
* @param string SQL statement.
* @return IDibiDriver|NULL
* @throws DibiDriverException
@@ -133,7 +121,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
*
* @return int|FALSE number of rows or FALSE on error
*/
public function affectedRows()
@@ -145,7 +132,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
*
* @return int|FALSE int on success or FALSE on failure
*/
public function insertId($sequence)
@@ -201,7 +187,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Returns the connection resource.
*
* @return mixed
*/
public function getResource()
@@ -217,7 +202,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Encodes data for use in an SQL statement.
*
* @param string value
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
* @return string encoded value
@@ -252,7 +236,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Decodes data from result set.
*
* @param string value
* @param string type (dibi::FIELD_BINARY)
* @return string decoded value
@@ -267,7 +250,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Injects LIMIT/OFFSET to the SQL query.
*
* @param string &$sql The SQL query that will be modified.
* @param int $limit
* @param int $offset
@@ -291,7 +273,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Returns the number of rows in a result set.
*
* @return int
*/
public function rowCount()
@@ -304,10 +285,9 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Fetches the row at current position and moves the internal cursor to the next position.
* internal usage only
*
* @param bool TRUE for associative array, FALSE for numeric
* @return array array on success, nonarray if no next record
* @internal
*/
public function fetch($assoc)
{
@@ -327,7 +307,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Moves cursor position without fetching row.
*
* @param int the 0-based cursor pos to seek to
* @return boolean TRUE on success, FALSE if unable to seek to specified record
* @throws DibiException
@@ -342,7 +321,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Frees the resources allocated for this result set.
*
* @return void
*/
public function free()
@@ -355,7 +333,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Returns metadata for all columns in a result set.
*
* @return array
*/
public function getColumnsMeta()
@@ -377,7 +354,6 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver
/**
* Returns the result set resource.
*
* @return mixed
*/
public function getResultResource()

View File

@@ -36,23 +36,15 @@
class DibiOracleDriver extends DibiObject implements IDibiDriver
{
/**
* Connection resource.
* @var resource
*/
/** @var resource Connection resource */
private $connection;
/**
* Resultset resource.
* @var resource
*/
/** @var resource Resultset resource */
private $resultSet;
/**
* @var bool
*/
/** @var bool */
private $autocommit = TRUE;
@@ -71,7 +63,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Connects to a database.
*
* @return void
* @throws DibiException
*/
@@ -94,7 +85,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Disconnects from a database.
*
* @return void
*/
public function disconnect()
@@ -106,7 +96,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Executes the SQL query.
*
* @param string SQL statement.
* @return IDibiDriver|NULL
* @throws DibiDriverException
@@ -133,7 +122,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
*
* @return int|FALSE number of rows or FALSE on error
*/
public function affectedRows()
@@ -145,7 +133,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
*
* @return int|FALSE int on success or FALSE on failure
*/
public function insertId($sequence)
@@ -201,7 +188,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Returns the connection resource.
*
* @return mixed
*/
public function getResource()
@@ -217,7 +203,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Encodes data for use in an SQL statement.
*
* @param string value
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
* @return string encoded value
@@ -253,7 +238,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Decodes data from result set.
*
* @param string value
* @param string type (dibi::FIELD_BINARY)
* @return string decoded value
@@ -268,7 +252,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Injects LIMIT/OFFSET to the SQL query.
*
* @param string &$sql The SQL query that will be modified.
* @param int $limit
* @param int $offset
@@ -288,7 +271,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Returns the number of rows in a result set.
*
* @return int
*/
public function rowCount()
@@ -300,10 +282,9 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Fetches the row at current position and moves the internal cursor to the next position.
* internal usage only
*
* @param bool TRUE for associative array, FALSE for numeric
* @return array array on success, nonarray if no next record
* @internal
*/
public function fetch($assoc)
{
@@ -314,7 +295,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Moves cursor position without fetching row.
*
* @param int the 0-based cursor pos to seek to
* @return boolean TRUE on success, FALSE if unable to seek to specified record
* @throws DibiException
@@ -328,7 +308,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Frees the resources allocated for this result set.
*
* @return void
*/
public function free()
@@ -341,7 +320,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Returns metadata for all columns in a result set.
*
* @return array
*/
public function getColumnsMeta()
@@ -363,7 +341,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver
/**
* Returns the result set resource.
*
* @return mixed
*/
public function getResultResource()

View File

@@ -37,24 +37,15 @@
class DibiPdoDriver extends DibiObject implements IDibiDriver
{
/**
* Connection resource.
* @var PDO
*/
/** @var PDO Connection resource */
private $connection;
/**
* Resultset resource.
* @var PDOStatement
*/
/** @var PDOStatement Resultset resource */
private $resultSet;
/**
* Affected rows.
* @var int|FALSE
*/
/** @var int|FALSE Affected rows */
private $affectedRows = FALSE;
@@ -73,7 +64,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Connects to a database.
*
* @return void
* @throws DibiException
*/
@@ -104,7 +94,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Disconnects from a database.
*
* @return void
*/
public function disconnect()
@@ -116,7 +105,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Executes the SQL query.
*
* @param string SQL statement.
* @return IDibiDriver|NULL
* @throws DibiDriverException
@@ -155,7 +143,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
*
* @return int|FALSE number of rows or FALSE on error
*/
public function affectedRows()
@@ -167,7 +154,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
*
* @return int|FALSE int on success or FALSE on failure
*/
public function insertId($sequence)
@@ -224,7 +210,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Returns the connection resource.
*
* @return PDO
*/
public function getResource()
@@ -240,7 +225,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Encodes data for use in an SQL statement.
*
* @param string value
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
* @return string encoded value
@@ -300,7 +284,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Decodes data from result set.
*
* @param string value
* @param string type (dibi::FIELD_BINARY)
* @return string decoded value
@@ -315,7 +298,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Injects LIMIT/OFFSET to the SQL query.
*
* @param string &$sql The SQL query that will be modified.
* @param int $limit
* @param int $offset
@@ -334,7 +316,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Returns the number of rows in a result set.
*
* @return int
*/
public function rowCount()
@@ -346,10 +327,9 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Fetches the row at current position and moves the internal cursor to the next position.
* internal usage only
*
* @param bool TRUE for associative array, FALSE for numeric
* @return array array on success, nonarray if no next record
* @internal
*/
public function fetch($assoc)
{
@@ -360,7 +340,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Moves cursor position without fetching row.
*
* @param int the 0-based cursor pos to seek to
* @return boolean TRUE on success, FALSE if unable to seek to specified record
* @throws DibiException
@@ -374,7 +353,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Frees the resources allocated for this result set.
*
* @return void
*/
public function free()
@@ -386,7 +364,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Returns metadata for all columns in a result set.
*
* @return array
* @throws DibiException
*/
@@ -414,7 +391,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Returns the result set resource.
*
* @return PDOStatement
*/
public function getResultResource()

View File

@@ -37,24 +37,15 @@
class DibiPostgreDriver extends DibiObject implements IDibiDriver
{
/**
* Connection resource.
* @var resource
*/
/** @var resource Connection resource */
private $connection;
/**
* Resultset resource.
* @var resource
*/
/** @var resource Resultset resource */
private $resultSet;
/**
* Escape method.
* @var bool
*/
/** @var bool Escape method */
private $escMethod = FALSE;
@@ -73,7 +64,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Connects to a database.
*
* @return void
* @throws DibiException
*/
@@ -121,7 +111,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Disconnects from a database.
*
* @return void
*/
public function disconnect()
@@ -133,7 +122,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Executes the SQL query.
*
* @param string SQL statement.
* @param bool update affected rows?
* @return IDibiDriver|NULL
@@ -154,7 +142,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
*
* @return int|FALSE number of rows or FALSE on error
*/
public function affectedRows()
@@ -166,7 +153,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
*
* @return int|FALSE int on success or FALSE on failure
*/
public function insertId($sequence)
@@ -225,7 +211,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Returns the connection resource.
*
* @return mixed
*/
public function getResource()
@@ -241,7 +226,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Encodes data for use in an SQL statement.
*
* @param string value
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
* @return string encoded value
@@ -292,7 +276,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Decodes data from result set.
*
* @param string value
* @param string type (dibi::FIELD_BINARY)
* @return string decoded value
@@ -313,7 +296,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Injects LIMIT/OFFSET to the SQL query.
*
* @param string &$sql The SQL query that will be modified.
* @param int $limit
* @param int $offset
@@ -336,7 +318,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Returns the number of rows in a result set.
*
* @return int
*/
public function rowCount()
@@ -348,10 +329,9 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Fetches the row at current position and moves the internal cursor to the next position.
* internal usage only
*
* @param bool TRUE for associative array, FALSE for numeric
* @return array array on success, nonarray if no next record
* @internal
*/
public function fetch($assoc)
{
@@ -362,7 +342,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Moves cursor position without fetching row.
*
* @param int the 0-based cursor pos to seek to
* @return boolean TRUE on success, FALSE if unable to seek to specified record
* @throws DibiException
@@ -376,7 +355,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Frees the resources allocated for this result set.
*
* @return void
*/
public function free()
@@ -389,7 +367,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Returns metadata for all columns in a result set.
*
* @return array
*/
public function getColumnsMeta()
@@ -413,7 +390,6 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
/**
* Returns the result set resource.
*
* @return mixed
*/
public function getResultResource()

View File

@@ -37,31 +37,19 @@
class DibiSqliteDriver extends DibiObject implements IDibiDriver
{
/**
* Connection resource.
* @var resource
*/
/** @var resource Connection resource */
private $connection;
/**
* Resultset resource.
* @var resource
*/
/** @var resource Resultset resource */
private $resultSet;
/**
* Is buffered (seekable and countable)?
* @var bool
*/
/** @var bool Is buffered (seekable and countable)? */
private $buffered;
/**
* Date and datetime format.
* @var string
*/
/** @var string Date and datetime format */
private $fmtDate, $fmtDateTime;
@@ -80,7 +68,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Connects to a database.
*
* @return void
* @throws DibiException
*/
@@ -108,7 +95,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Disconnects from a database.
*
* @return void
*/
public function disconnect()
@@ -120,7 +106,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Executes the SQL query.
*
* @param string SQL statement.
* @return IDibiDriver|NULL
* @throws DibiDriverException
@@ -144,7 +129,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
*
* @return int|FALSE number of rows or FALSE on error
*/
public function affectedRows()
@@ -156,7 +140,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
*
* @return int|FALSE int on success or FALSE on failure
*/
public function insertId($sequence)
@@ -204,7 +187,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Returns the connection resource.
*
* @return mixed
*/
public function getResource()
@@ -220,7 +202,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Encodes data for use in an SQL statement.
*
* @param string value
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
* @return string encoded value
@@ -254,7 +235,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Decodes data from result set.
*
* @param string value
* @param string type (dibi::FIELD_BINARY)
* @return string decoded value
@@ -269,7 +249,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Injects LIMIT/OFFSET to the SQL query.
*
* @param string &$sql The SQL query that will be modified.
* @param int $limit
* @param int $offset
@@ -289,7 +268,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Returns the number of rows in a result set.
*
* @return int
*/
public function rowCount()
@@ -304,10 +282,9 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Fetches the row at current position and moves the internal cursor to the next position.
* internal usage only
*
* @param bool TRUE for associative array, FALSE for numeric
* @return array array on success, nonarray if no next record
* @internal
*/
public function fetch($assoc)
{
@@ -326,7 +303,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Moves cursor position without fetching row.
*
* @param int the 0-based cursor pos to seek to
* @return boolean TRUE on success, FALSE if unable to seek to specified record
* @throws DibiException
@@ -343,7 +319,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Frees the resources allocated for this result set.
*
* @return void
*/
public function free()
@@ -355,7 +330,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Returns metadata for all columns in a result set.
*
* @return array
*/
public function getColumnsMeta()
@@ -379,7 +353,6 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
/**
* Returns the result set resource.
*
* @return mixed
*/
public function getResultResource()

View File

@@ -29,41 +29,25 @@
*/
class DibiConnection extends DibiObject
{
/**
* Current connection configuration.
* @var array
*/
/** @var array Current connection configuration */
private $config;
/**
* Driver
* @var IDibiDriver
*/
/** @var IDibiDriver Driver */
private $driver;
/**
* Profiler
* @var IDibiProfiler
*/
/** @var IDibiProfiler Profiler */
private $profiler;
/**
* Is connected?
* @var bool
*/
/** @var bool Is connected? */
private $connected = FALSE;
/**
* Is in transaction?
* @var bool
*/
/** @var bool Is in transaction? */
private $inTxn = FALSE;
/**
* Creates object and (optionally) connects to a database.
*
* @param array|string|ArrayObject connection parameters
* @param string connection name
* @throws DibiException
@@ -123,7 +107,6 @@ class DibiConnection extends DibiObject
/**
* Automatically frees the resources allocated for this result set.
*
* @return void
*/
public function __destruct()
@@ -136,7 +119,6 @@ class DibiConnection extends DibiObject
/**
* Connects to a database.
*
* @return void
*/
final protected function connect()
@@ -157,7 +139,6 @@ class DibiConnection extends DibiObject
/**
* Disconnects from a database.
*
* @return void
*/
final public function disconnect()
@@ -175,7 +156,6 @@ class DibiConnection extends DibiObject
/**
* Returns TRUE when connection was established.
*
* @return bool
*/
final public function isConnected()
@@ -187,7 +167,6 @@ class DibiConnection extends DibiObject
/**
* Returns configuration variable. If no $key is passed, returns the entire array.
*
* @see self::__construct
* @param string
* @param mixed default value to use if key not found
@@ -210,7 +189,6 @@ class DibiConnection extends DibiObject
/**
* Apply configuration alias or default values.
*
* @param array connect configuration
* @param string key
* @param string alias key
@@ -232,7 +210,6 @@ class DibiConnection extends DibiObject
/**
* Returns the connection resource.
*
* @return resource
*/
final public function getResource()
@@ -244,7 +221,6 @@ class DibiConnection extends DibiObject
/**
* Generates (translates) and executes SQL query.
*
* @param array|mixed one or more arguments
* @return DibiResult|NULL result set object (if any)
* @throws DibiException
@@ -265,7 +241,6 @@ class DibiConnection extends DibiObject
/**
* Generates and prints SQL query.
*
* @param array|mixed one or more arguments
* @return bool
*/
@@ -283,7 +258,6 @@ class DibiConnection extends DibiObject
/**
* Executes the SQL query.
*
* @param string SQL statement.
* @return DibiResult|NULL result set object (if any)
* @throws DibiException
@@ -327,7 +301,6 @@ class DibiConnection extends DibiObject
/**
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
*
* @return int number of rows
* @throws DibiException
*/
@@ -342,7 +315,6 @@ class DibiConnection extends DibiObject
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
*
* @param string optional sequence name
* @return int
* @throws DibiException
@@ -422,7 +394,6 @@ class DibiConnection extends DibiObject
/**
* Encodes data for use in an SQL statement.
*
* @param string unescaped string
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
* @return string escaped and quoted string
@@ -437,7 +408,6 @@ class DibiConnection extends DibiObject
/**
* Decodes data from result set.
*
* @param string value
* @param string type (dibi::FIELD_BINARY)
* @return string decoded value
@@ -451,7 +421,6 @@ class DibiConnection extends DibiObject
/**
* Delimites identifier (table's or column's name, etc.).
*
* @param string identifier
* @return string delimited identifier
*/
@@ -464,7 +433,6 @@ class DibiConnection extends DibiObject
/**
* Injects LIMIT/OFFSET to the SQL query.
*
* @param string &$sql The SQL query that will be modified.
* @param int $limit
* @param int $offset
@@ -570,7 +538,6 @@ class DibiConnection extends DibiObject
/**
* Import SQL dump from file - extreme fast!
*
* @param string filename
* @return int count of sql commands
*/
@@ -604,7 +571,6 @@ class DibiConnection extends DibiObject
/**
* Gets a information about the current database.
*
* @return DibiDatabaseInfo
*/
public function getDatabaseInfo()

View File

@@ -22,7 +22,10 @@
/**
* Reflection metadata class for a database.
* @package dibi
*
* @author David Grudl
* @copyright Copyright (c) 2005, 2008 David Grudl
* @package dibi
*/
class DibiDatabaseInfo extends DibiObject
{
@@ -131,7 +134,10 @@ class DibiDatabaseInfo extends DibiObject
/**
* Reflection metadata class for a database table.
* @package dibi
*
* @author David Grudl
* @copyright Copyright (c) 2005, 2008 David Grudl
* @package dibi
*/
class DibiTableInfo extends DibiObject
{
@@ -328,7 +334,10 @@ class DibiTableInfo extends DibiObject
/**
* Reflection metadata class for a table column.
* @package dibi
*
* @author David Grudl
* @copyright Copyright (c) 2005, 2008 David Grudl
* @package dibi
*/
class DibiColumnInfo extends DibiObject
{
@@ -494,7 +503,10 @@ class DibiColumnInfo extends DibiObject
/**
* Reflection metadata class for a foreign key.
* @package dibi
*
* @author David Grudl
* @copyright Copyright (c) 2005, 2008 David Grudl
* @package dibi
* @todo
*/
class DibiForeignKeyInfo extends DibiObject
@@ -540,7 +552,10 @@ class DibiForeignKeyInfo extends DibiObject
/**
* Reflection metadata class for a index or primary key
* @package dibi
*
* @author David Grudl
* @copyright Copyright (c) 2005, 2008 David Grudl
* @package dibi
*/
class DibiIndexInfo extends DibiObject
{

View File

@@ -52,7 +52,6 @@ class DibiDriverException extends DibiException implements /*Nette::*/IDebuggabl
/**
* Construct an dibi driver exception.
*
* @param string Message describing the exception
* @param int Some code
* @param string SQL command
@@ -113,7 +112,6 @@ class DibiDriverException extends DibiException implements /*Nette::*/IDebuggabl
/**
* Starts catching potential errors/warnings
*
* @return void
*/
public static function tryError()
@@ -126,7 +124,6 @@ class DibiDriverException extends DibiException implements /*Nette::*/IDebuggabl
/**
* Returns catched error/warning message.
*
* @param string catched message
* @return bool
*/
@@ -142,6 +139,7 @@ class DibiDriverException extends DibiException implements /*Nette::*/IDebuggabl
/**
* Internal error handler. Do not call directly.
* @internal
*/
public static function _errorHandler($code, $message)
{

View File

@@ -71,7 +71,6 @@ abstract class DibiObject
/**
* Returns the name of the class of this object.
*
* @return string
*/
final public /*static*/ function getClass()
@@ -83,7 +82,6 @@ abstract class DibiObject
/**
* Access to reflection.
*
* @return ReflectionObject
*/
final public function getReflection()
@@ -95,7 +93,6 @@ abstract class DibiObject
/**
* Call to undefined method.
*
* @param string method name
* @param array arguments
* @return mixed
@@ -141,7 +138,6 @@ abstract class DibiObject
/**
* Call to undefined static method.
*
* @param string method name (in lower case!)
* @param array arguments
* @return mixed
@@ -157,7 +153,6 @@ abstract class DibiObject
/**
* Adding method to class.
*
* @param string method name
* @param mixed callback or closure
* @return mixed
@@ -220,7 +215,6 @@ abstract class DibiObject
/**
* Returns property value. Do not call directly.
*
* @param string property name
* @return mixed property value
* @throws ::MemberAccessException if the property is not defined.
@@ -258,7 +252,6 @@ abstract class DibiObject
/**
* Sets value of a property. Do not call directly.
*
* @param string property name
* @param mixed property value
* @return void
@@ -294,7 +287,6 @@ abstract class DibiObject
/**
* Is property defined?
*
* @param string property name
* @return bool
*/
@@ -308,7 +300,6 @@ abstract class DibiObject
/**
* Access to undeclared property.
*
* @param string property name
* @return void
* @throws ::MemberAccessException
@@ -323,7 +314,6 @@ abstract class DibiObject
/**
* Has property an accessor?
*
* @param string class name
* @param string method name
* @return bool

View File

@@ -42,34 +42,19 @@
*/
class DibiResult extends DibiObject implements IDataSource
{
/**
* IDibiDriver.
* @var array
*/
/** @var array IDibiDriver */
private $driver;
/**
* Translate table.
* @var array
*/
/** @var array Translate table */
private $xlat;
/**
* Cache for $driver->getColumnsMeta().
* @var array
*/
/** @var array Cache for $driver->getColumnsMeta() */
private $meta;
/**
* Already fetched? Used for allowance for first seek(0).
* @var bool
*/
/** @var bool Already fetched? Used for allowance for first seek(0) */
private $fetched = FALSE;
/**
* Qualifiy each column name with the table name?
* @var array|FALSE
*/
/** @var array|FALSE Qualifiy each column name with the table name? */
private $withTables = FALSE;
@@ -91,7 +76,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Automatically frees the resources allocated for this result set.
*
* @return void
*/
public function __destruct()
@@ -103,7 +87,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Returns the result set resource.
*
* @return mixed
*/
final public function getResource()
@@ -115,7 +98,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Moves cursor position without fetching row.
*
* @param int the 0-based cursor pos to seek to
* @return boolean TRUE on success, FALSE if unable to seek to specified record
* @throws DibiException
@@ -129,7 +111,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Returns the number of rows in a result set.
*
* @return int
*/
final public function rowCount()
@@ -141,7 +122,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Frees the resources allocated for this result set.
*
* @return void
*/
final public function free()
@@ -156,7 +136,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Qualifiy each column name with the table name?
*
* @param bool
* @return void
* @throws DibiException
@@ -185,7 +164,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Qualifiy each key with the table name?
*
* @return bool
*/
final public function getWithTables()
@@ -198,7 +176,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Fetches the row at current position, process optional type conversion.
* and moves the internal cursor to the next position
*
* @return DibiRow|FALSE array on success, FALSE if no next record
*/
final public function fetch()
@@ -231,7 +208,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Like fetch(), but returns only first field.
*
* @return mixed value on success, FALSE if no next record
*/
final public function fetchSingle()
@@ -255,7 +231,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Fetches all records from table.
*
* @param int offset
* @param int limit
* @return array of DibiRow
@@ -283,7 +258,6 @@ class DibiResult extends DibiObject implements IDataSource
* Fetches all records from table and returns associative tree.
* Associative descriptor: assoc1,#,assoc2,=,assoc3,@
* builds a tree: $data[assoc1][index][assoc2]['assoc3']->value = {record}
*
* @param string associative descriptor
* @return DibiRow
* @throws InvalidArgumentException
@@ -371,7 +345,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Fetches all records from table like $key => $value pairs.
*
* @param string associative key
* @param string value
* @return array
@@ -456,9 +429,10 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Define multiple columns types (for internal usage).
* Define multiple columns types.
* @param array
* @return void
* @internal
*/
final public function setTypes(array $types)
{
@@ -518,7 +492,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Gets an array of meta informations about columns.
*
* @return array of DibiColumnInfo
*/
final public function getColumns()
@@ -549,7 +522,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Displays complete result-set as HTML table for debug purposes.
*
* @return void
*/
final public function dump()
@@ -611,7 +583,6 @@ class DibiResult extends DibiObject implements IDataSource
/**
* Safe access to property $driver.
*
* @return IDibiDriver
* @throws InvalidStateException
*/

View File

@@ -80,7 +80,6 @@ final class DibiTranslator extends DibiObject
/**
* Generates SQL.
*
* @param array
* @return bool
*/
@@ -468,7 +467,6 @@ final class DibiTranslator extends DibiObject
/**
* Apply substitutions to indentifier and delimites it.
*
* @param string indentifier
* @return string
*/

View File

@@ -28,7 +28,6 @@ interface IDibiVariable
{
/**
* Format for SQL.
*
* @param DibiTranslator
* @param string optional modifier
* @return string SQL code
@@ -116,8 +115,7 @@ interface IDibiDriver
{
/**
* Internal: Connects to a database.
*
* Connects to a database.
* @param array
* @return void
* @throws DibiException
@@ -127,8 +125,7 @@ interface IDibiDriver
/**
* Internal: Disconnects from a database.
*
* Disconnects from a database.
* @return void
* @throws DibiException
*/
@@ -138,7 +135,6 @@ interface IDibiDriver
/**
* Internal: Executes the SQL query.
*
* @param string SQL statement.
* @return IDibiDriver|NULL
* @throws DibiDriverException
@@ -149,7 +145,6 @@ interface IDibiDriver
/**
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
*
* @return int|FALSE number of rows or FALSE on error
*/
function affectedRows();
@@ -158,7 +153,6 @@ interface IDibiDriver
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
*
* @return int|FALSE int on success or FALSE on failure
*/
function insertId($sequence);
@@ -194,7 +188,6 @@ interface IDibiDriver
/**
* Returns the connection resource.
*
* @return mixed
*/
function getResource();
@@ -207,7 +200,6 @@ interface IDibiDriver
/**
* Encodes data for use in an SQL statement.
*
* @param string value
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
* @return string encoded value
@@ -219,7 +211,6 @@ interface IDibiDriver
/**
* Decodes data from result set.
*
* @param string value
* @param string type (dibi::FIELD_BINARY)
* @return string decoded value
@@ -231,7 +222,6 @@ interface IDibiDriver
/**
* Injects LIMIT/OFFSET to the SQL query.
*
* @param string &$sql The SQL query that will be modified.
* @param int $limit
* @param int $offset
@@ -247,7 +237,6 @@ interface IDibiDriver
/**
* Returns the number of rows in a result set.
*
* @return int
*/
function rowCount();
@@ -256,7 +245,6 @@ interface IDibiDriver
/**
* Moves cursor position without fetching row.
*
* @param int the 0-based cursor pos to seek to
* @return boolean TRUE on success, FALSE if unable to seek to specified record
* @throws DibiException
@@ -267,10 +255,9 @@ interface IDibiDriver
/**
* Fetches the row at current position and moves the internal cursor to the next position.
* internal usage only
*
* @param bool TRUE for associative array, FALSE for numeric
* @return array array on success, nonarray if no next record
* @internal
*/
function fetch($type);
@@ -278,7 +265,6 @@ interface IDibiDriver
/**
* Frees the resources allocated for this result set.
*
* @param resource result set resource
* @return void
*/
@@ -288,7 +274,6 @@ interface IDibiDriver
/**
* Returns metadata for all columns in a result set.
*
* @return array
* @throws DibiException
*/
@@ -298,7 +283,6 @@ interface IDibiDriver
/**
* Returns the result set resource.
*
* @return mixed
*/
function getResultResource();