\Query\DriverDriver_Interface

PDO Interface to implement for database drivers

Summary

Methods
Constants
__construct()
beginTransaction()
commit()
errorCode()
errorInfo()
exec()
getAttribute()
rollback()
setAttribute()
get_columns()
get_fks()
get_tables()
quote_ident()
quote_table()
prepare_execute()
get_sql()
get_util()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

__construct()

__construct(string $dsn, string $username, string $password, array $driver_options)

Constructor/Connection method

Parameters

string $dsn
string $username
string $password
array $driver_options

beginTransaction()

beginTransaction() : bool

Begin a transaction

Returns

bool

commit()

commit() : bool

Commit a transaction

Returns

bool

errorCode()

errorCode() : mixed

Return the current error code

Returns

mixed

errorInfo()

errorInfo() : array

Return information about the current error

Returns

array

exec()

exec(string $statement) : int

Execute an SQL statement and return the number of affected rows

Parameters

string $statement

Returns

int

getAttribute()

getAttribute(int $attribute) : mixed

Get a connection attribute for the current db driver

Parameters

int $attribute

Returns

mixed

rollback()

rollback() : bool

Rollback a transaction

Returns

bool

setAttribute()

setAttribute(int $attribute, mixed $value) : bool

Set a connection attribute

Parameters

int $attribute
mixed $value

Returns

bool

get_columns()

get_columns(string $table) : array

Retrieve column information for the current database table

Parameters

string $table

Returns

array

get_fks()

get_fks(string $table) : array

Retrieve foreign keys for the table

Parameters

string $table

Returns

array

get_tables()

get_tables() : array

Return list of tables for the current database

Returns

array

quote_ident()

quote_ident(mixed $ident) : string

Surrounds the string with the databases identifier escape characters

Parameters

mixed $ident

Returns

string

quote_table()

quote_table(string $table) : string

Quote database table name, and set prefix

Parameters

string $table

Returns

string

prepare_execute()

prepare_execute(string $sql, array $params) : \PDOStatement

Create and execute a prepared statement with the provided parameters

Parameters

string $sql
array $params

Returns

\PDOStatement