Methods summary
public
|
#
connect( array & $config )
Connects to a database.
Parameters
Throws
|
public
|
#
disconnect( )
Disconnects from a database.
Disconnects from a database.
Throws
|
public
IDibiResultDriver|null
|
#
query( string $sql )
Internal: Executes the SQL query.
Internal: Executes the SQL query.
Parameters
- $sql
string SQL statement.
Returns
Throws
|
public
integer|false
|
#
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|false number of rows or FALSE on error
|
public
integer|false
|
#
getInsertId( $sequence )
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.
Returns
integer|false int on success or FALSE on failure
|
public
|
#
begin( string $savepoint = NULL )
Begins a transaction (if supported).
Begins a transaction (if supported).
Parameters
- $savepoint
string optional savepoint name
Throws
|
public
|
#
commit( string $savepoint = NULL )
Commits statements in a transaction.
Commits statements in a transaction.
Parameters
- $savepoint
string optional savepoint name
Throws
|
public
|
#
rollback( string $savepoint = NULL )
Rollback changes in a transaction.
Rollback changes in a transaction.
Parameters
- $savepoint
string optional savepoint name
Throws
|
public
mixed
|
#
getResource( )
Returns the connection resource.
Returns the connection resource.
Returns
mixed
|
public
IDibiReflector
|
#
getReflector( )
Returns the connection reflector.
Returns the connection reflector.
Returns
|
public
string
|
#
escape( string $value, string $type )
Encodes data for use in a SQL statement.
Encodes data for use in a SQL statement.
Parameters
- $value
string value
- $type
string type (dibi::TEXT, dibi::BOOL, ...)
Returns
string encoded value
Throws
|
public
string
|
#
escapeLike( string $value, integer $pos )
Encodes string for use in a LIKE statement.
Encodes string for use in a LIKE statement.
Parameters
- $value
string
- $pos
integer
Returns
string
|
public
|
#
applyLimit( string & $sql, integer $limit, integer $offset )
Injects LIMIT/OFFSET to the SQL query.
Injects LIMIT/OFFSET to the SQL query.
Parameters
- $sql
string &$sql The SQL query that will be modified.
- $limit
integer
- $offset
integer
|