Methods summary
public
|
#
__construct( mixed $config, string $name = NULL )
Connection options: (see driver-specific options too)
- lazy (bool) => if TRUE, connection will be established only when
required
- result (array) => result set options
- formatDateTime => date-time format (if empty, DateTime objects will be
returned)
- profiler (array or bool)
- run (bool) => enable profiler?
- file => file to log
- substitutes (array) => map of driver specific substitutes (under
development)
Connection options: (see driver-specific options too) - lazy (bool) => if
TRUE, connection will be established only when required - result (array) =>
result set options - formatDateTime => date-time format (if empty, DateTime
objects will be returned) - profiler (array or bool) - run (bool) => enable
profiler? - file => file to log - substitutes (array) => map of driver
specific substitutes (under development)
Parameters
- $config
mixed connection parameters
- $name
string connection name
Throws
|
public
|
#
__destruct( )
Automatically frees the resources allocated for this result set.
Automatically frees the resources allocated for this result set.
|
final public
|
|
final public
|
#
disconnect( )
Disconnects from a database.
Disconnects from a database.
|
final public
boolean
|
#
isConnected( )
Returns TRUE when connection was established.
Returns TRUE when connection was established.
Returns
boolean
|
final public
mixed
|
#
getConfig( string $key = NULL, mixed $default = NULL )
Returns configuration variable. If no $key is passed, returns the entire
array.
Returns configuration variable. If no $key is passed, returns the entire
array.
Parameters
- $key
string
- $default
mixed default value to use if key not found
Returns
mixed
See
|
public static
|
#
alias( array & $config, string $key, string $alias )
Apply configuration alias or default values.
Apply configuration alias or default values.
Parameters
- $config
array connect configuration
- $key
string key
- $alias
string alias key
|
final public
IDibiDriver
|
#
getDriver( )
Returns the driver and connects to a database in lazy mode.
Returns the driver and connects to a database in lazy mode.
Returns
|
final public
DibiResult|integer
|
#
query( array|mixed $args )
Generates (translates) and executes SQL query.
Generates (translates) and executes SQL query.
Parameters
- $args
array|mixed one or more arguments
Returns
Throws
|
final public
string
|
#
translate( array|mixed $args )
Generates SQL query.
Parameters
- $args
array|mixed one or more arguments
Returns
string
Throws
|
final public
boolean
|
#
test( array|mixed $args )
Generates and prints SQL query.
Generates and prints SQL query.
Parameters
- $args
array|mixed one or more arguments
Returns
boolean
|
final public
DibiDataSource
|
#
dataSource( array|mixed $args )
Generates (translates) and returns SQL query as DibiDataSource.
Generates (translates) and returns SQL query as DibiDataSource.
Parameters
- $args
array|mixed one or more arguments
Returns
Throws
|
final public
DibiResult|integer
|
#
nativeQuery( string $sql )
Executes the SQL query.
Parameters
- $sql
string SQL statement.
Returns
Throws
|
public
integer
|
#
getAffectedRows( )
Gets the number of affected rows by the last INSERT, UPDATE or DELETE
query.
Gets the number of affected rows by the last INSERT, UPDATE or DELETE
query.
Returns
integer number of rows
Throws
|
public
integer
|
#
affectedRows( )
Gets the number of affected rows. Alias for getAffectedRows().
Gets the number of affected rows. Alias for getAffectedRows().
Returns
integer number of rows
Throws
|
public
integer
|
#
getInsertId( string $sequence = NULL )
Retrieves the ID generated for an AUTO_INCREMENT column by the previous
INSERT query.
Retrieves the ID generated for an AUTO_INCREMENT column by the previous
INSERT query.
Parameters
- $sequence
string optional sequence name
Returns
integer
Throws
|
public
integer
|
#
insertId( string $sequence = NULL )
Retrieves the ID generated for an AUTO_INCREMENT column. Alias for
getInsertId().
Retrieves the ID generated for an AUTO_INCREMENT column. Alias for
getInsertId().
Parameters
- $sequence
string optional sequence name
Returns
integer
Throws
|
public
|
#
begin( string $savepoint = NULL )
Begins a transaction (if supported).
Begins a transaction (if supported).
Parameters
- $savepoint
string optional savepoint name
|
public
|
#
commit( string $savepoint = NULL )
Commits statements in a transaction.
Commits statements in a transaction.
Parameters
- $savepoint
string optional savepoint name
|
public
|
#
rollback( string $savepoint = NULL )
Rollback changes in a transaction.
Rollback changes in a transaction.
Parameters
- $savepoint
string optional savepoint name
|
public
DibiResult
|
|
public
DibiFluent
|
|
public
DibiFluent
|
|
public
DibiFluent
|
#
update( string $table, array $args )
Parameters
- $table
string table
- $args
array
Returns
|
public
DibiFluent
|
#
insert( string $table, array $args )
Parameters
- $table
string table
- $args
array
Returns
|
public
DibiFluent
|
|
public
DibiHashMap
|
#
getSubstitutes( )
Returns substitution hashmap.
Returns substitution hashmap.
Returns
DibiHashMap
|
public
string
|
#
substitute( $value )
Provides substitution.
Returns
string
|
public
DibiRow
|
#
fetch( array|mixed $args )
Executes SQL query and fetch result - shortcut for query() & fetch().
Executes SQL query and fetch result - shortcut for query() & fetch().
Parameters
- $args
array|mixed one or more arguments
Returns
Throws
|
public
array
|
#
fetchAll( array|mixed $args )
Executes SQL query and fetch results - shortcut for query() &
fetchAll().
Executes SQL query and fetch results - shortcut for query() &
fetchAll().
Parameters
- $args
array|mixed one or more arguments
Returns
array of DibiRow
Throws
|
public
string
|
#
fetchSingle( array|mixed $args )
Executes SQL query and fetch first column - shortcut for query() &
fetchSingle().
Executes SQL query and fetch first column - shortcut for query() &
fetchSingle().
Parameters
- $args
array|mixed one or more arguments
Returns
string
Throws
|
public
string
|
#
fetchPairs( array|mixed $args )
Executes SQL query and fetch pairs - shortcut for query() &
fetchPairs().
Executes SQL query and fetch pairs - shortcut for query() &
fetchPairs().
Parameters
- $args
array|mixed one or more arguments
Returns
string
Throws
|
public
integer
|
#
loadFile( string $file )
Import SQL dump from file - extreme fast!
Import SQL dump from file - extreme fast!
Parameters
Returns
integer count of sql commands
|
public
DibiDatabaseInfo
|
#
getDatabaseInfo( )
Gets a information about the current database.
Gets a information about the current database.
Returns
|
public
|
#
__wakeup( )
Prevents unserialization.
Prevents unserialization.
|
public
|
|