mirror of
https://github.com/dg/dibi.git
synced 2025-08-15 02:25:10 +02:00
- phpDoc simplified
This commit is contained in:
@@ -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()
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
*/
|
||||
|
@@ -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
|
||||
*/
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user