Interface IDibiDriver


dibi driver interface.


Copyright: Copyright (c) 2005, 2010 David Grudl
Located: in /libs/interfaces.php (line 86)
Method Summary
void
applyLimit (string &$sql, int $limit, int $offset)
Injects LIMIT/OFFSET to the SQL query.
void
begin ([string $savepoint = NULL])
Begins a transaction (if supported).
void
commit ([string $savepoint = NULL])
Commits statements in a transaction.
void
connect (&$config)
Connects to a database.
void
Disconnects from a database.
string
escape (string $value, string $type)
Encodes data for use in a SQL statement.
string
escapeLike (string $value, int $pos)
Encodes string for use in a LIKE statement.
int|FALSE
Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
int|FALSE
getInsertId ($sequence)
Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
IDibiReflector
Returns the connection reflector.
mixed
Returns the connection resource.
IDibiResultDriver|NULL
query (string $sql)
Internal: Executes the SQL query.
void
rollback ([string $savepoint = NULL])
Rollback changes in a transaction.

Method Details

line 184

applyLimit

public void applyLimit (string &$sql, int $limit, int $offset)

Injects LIMIT/OFFSET to the SQL query.

Input
string &$sql The SQL query that will be modified.
int $limit
int $offset

line 130

begin

public void begin ([string $savepoint = NULL])

Begins a transaction (if supported).

Input
string $savepoint optional savepoint name
Output
void  
Throws
throws DibiDriverException

line 138

commit

public void commit ([string $savepoint = NULL])

Commits statements in a transaction.

Input
string $savepoint optional savepoint name
Output
void  
Throws
throws DibiDriverException

line 95

connect

public void connect (&$config)

Connects to a database.

Input
&$config
Output
void  
Throws
throws DibiException

line 102

disconnect

public void disconnect ()

Disconnects from a database.

Output
void  
Throws
throws DibiException

line 167

escape

public string escape (string $value, string $type)

Encodes data for use in a SQL statement.

Input
string $value value
string $type type (dibi::TEXT, dibi::BOOL, ...)
Output
string encoded value
Throws
throws InvalidArgumentException

line 175

escapeLike

public string escapeLike (string $value, int $pos)

Encodes string for use in a LIKE statement.

Input
string $value
int $pos

line 116

getAffectedRows

public int|FALSE getAffectedRows ()

Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.

Output
int|FALSE number of rows or FALSE on error

line 122

getInsertId

public int|FALSE getInsertId ($sequence)

Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.

Input
$sequence
Output
int|FALSE int on success or FALSE on failure

line 158

getReflector

public IDibiReflector getReflector ()

Returns the connection reflector.

line 152

getResource

public mixed getResource ()

Returns the connection resource.

line 110

query

public IDibiResultDriver|NULL query (string $sql)

Internal: Executes the SQL query.

Input
string $sql SQL statement.
Output
IDibiResultDriver|NULL  
Throws
throws DibiDriverException

line 146

rollback

public void rollback ([string $savepoint = NULL])

Rollback changes in a transaction.

Input
string $savepoint optional savepoint name
Output
void  
Throws
throws DibiDriverException