interface IConnection

Dibi connection.

Methods

void
connect()

Connects to a database.

void
disconnect()

Disconnects from a database.

bool
isConnected()

Returns true when connection was established.

getDriver()

Returns the driver and connects to a database in lazy mode.

query(...$args)

Generates (translates) and executes SQL query.

int
getAffectedRows()

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

int
getInsertId(string $sequence = null)

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

void
begin(string $savepoint = null)

Begins a transaction (if supported).

void
commit(string $savepoint = null)

Commits statements in a transaction.

void
rollback(string $savepoint = null)

Rollback changes in a transaction.

Details

at line 194
void connect()

Connects to a database.

Return Value

void

at line 199
void disconnect()

Disconnects from a database.

Return Value

void

at line 204
bool isConnected()

Returns true when connection was established.

Return Value

bool

at line 209
Driver getDriver()

Returns the driver and connects to a database in lazy mode.

Return Value

Driver

at line 215
Result query(...$args)

Generates (translates) and executes SQL query.

Parameters

...$args

Return Value

Result

Exceptions

Exception

at line 221
int getAffectedRows()

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

Return Value

int

Exceptions

Exception

at line 227
int getInsertId(string $sequence = null)

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

Parameters

string $sequence

Return Value

int

Exceptions

Exception

at line 232
void begin(string $savepoint = null)

Begins a transaction (if supported).

Parameters

string $savepoint

Return Value

void

at line 237
void commit(string $savepoint = null)

Commits statements in a transaction.

Parameters

string $savepoint

Return Value

void

at line 242
void rollback(string $savepoint = null)

Rollback changes in a transaction.

Parameters

string $savepoint

Return Value

void