interface Driver

Driver interface.

Methods

void
connect(array $config)

Connects to a database.

void
disconnect()

Disconnects from a database.

query($sql)

Internal: Executes the SQL query.

int|false
getAffectedRows()

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.

void
begin($savepoint = null)

Begins a transaction (if supported).

void
commit($savepoint = null)

Commits statements in a transaction.

void
rollback($savepoint = null)

Rollback changes in a transaction.

mixed
getResource()

Returns the connection resource.

getReflector()

Returns the connection reflector.

string
escapeText($value)

Encodes data for use in a SQL statement.

string
escapeBinary($value)

No description

string
escapeIdentifier($value)

No description

string
escapeBool($value)

No description

string
escapeDate($value)

No description

string
escapeDateTime($value)

No description

string
escapeLike($value, $pos)

Encodes string for use in a LIKE statement.

void
applyLimit($sql, $limit, $offset)

Injects LIMIT/OFFSET to the SQL query.

Details

at line 32
void connect(array $config)

Connects to a database.

Parameters

array $config

Return Value

void

Exceptions

Exception

at line 39
void disconnect()

Disconnects from a database.

Return Value

void

Exceptions

Exception

at line 47
ResultDriver|null query($sql)

Internal: Executes the SQL query.

Parameters

$sql

Return Value

ResultDriver|null

Exceptions

DriverException

at line 53
int|false getAffectedRows()

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

Return Value

int|false

number of rows or false on error

at line 59
int|false getInsertId($sequence)

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

Parameters

$sequence

Return Value

int|false

int on success or false on failure

at line 67
void begin($savepoint = null)

Begins a transaction (if supported).

Parameters

$savepoint

Return Value

void

Exceptions

DriverException

at line 75
void commit($savepoint = null)

Commits statements in a transaction.

Parameters

$savepoint

Return Value

void

Exceptions

DriverException

at line 83
void rollback($savepoint = null)

Rollback changes in a transaction.

Parameters

$savepoint

Return Value

void

Exceptions

DriverException

at line 89
mixed getResource()

Returns the connection resource.

Return Value

mixed

at line 95
Reflector getReflector()

Returns the connection reflector.

Return Value

Reflector

at line 102
string escapeText($value)

Encodes data for use in a SQL statement.

Parameters

$value

Return Value

string

encoded value

at line 108
string escapeBinary($value)

No description

Parameters

$value

Return Value

string

at line 114
string escapeIdentifier($value)

No description

Parameters

$value

Return Value

string

at line 120
string escapeBool($value)

No description

Parameters

$value

Return Value

string

at line 126
string escapeDate($value)

No description

Parameters

$value

Return Value

string

at line 132
string escapeDateTime($value)

No description

Parameters

$value

Return Value

string

at line 140
string escapeLike($value, $pos)

Encodes string for use in a LIKE statement.

Parameters

$value
$pos

Return Value

string

at line 149
void applyLimit($sql, $limit, $offset)

Injects LIMIT/OFFSET to the SQL query.

Parameters

$sql
$limit
$offset

Return Value

void