JanRain OpenID Library

Auth_OpenID_DatabaseConnection
in package

An empty base class intended to emulate PEAR connection functionality in applications that supply their own database abstraction mechanisms. See {@link Auth_OpenID_SQLStore} for more information. You should subclass this class if you need to create an SQL store that needs to access its database using an application's database abstraction layer instead of a PEAR database connection. Any subclass of Auth_OpenID_DatabaseConnection MUST adhere to the interface specified here.

Table of Contents

autoCommit()  : mixed
Sets auto-commit mode on this database connection.
begin()  : mixed
Starts a transaction on this connection, if supported.
commit()  : mixed
Commits a transaction on this connection, if supported.
getAll()  : array<string|int, mixed>
Run an SQL query with the specified parameters, if any.
getOne()  : mixed
Run an SQL query and return the first column of the first row of the result set, if any.
getRow()  : array<string|int, mixed>|bool
Run an SQL query and return the first row of the result set, if any.
query()  : mixed
Run an SQL query with the specified parameters, if any.
rollback()  : mixed
Performs a rollback on this connection, if supported.

Methods

autoCommit()

Sets auto-commit mode on this database connection.

public autoCommit(bool $mode) : mixed
Parameters
$mode : bool

True if auto-commit is to be used; false if not.

Return values
mixed

begin()

Starts a transaction on this connection, if supported.

public begin() : mixed
Return values
mixed

commit()

Commits a transaction on this connection, if supported.

public commit() : mixed
Return values
mixed

getAll()

Run an SQL query with the specified parameters, if any.

public getAll(string $sql[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
$sql : string

An SQL string with placeholders. The placeholders are assumed to be specific to the database engine for this connection.

$params : array<string|int, mixed> = []

An array of parameters to insert into the SQL string using this connection's escaping mechanism.

Return values
array<string|int, mixed>

$result An array of arrays representing the result of the query; each array is keyed on column name.

getOne()

Run an SQL query and return the first column of the first row of the result set, if any.

public getOne(string $sql[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
$sql : string

An SQL string with placeholders. The placeholders are assumed to be specific to the database engine for this connection.

$params : array<string|int, mixed> = []

An array of parameters to insert into the SQL string using this connection's escaping mechanism.

Return values
mixed

$result The value of the first column of the first row of the result set. False if no such result was found.

getRow()

Run an SQL query and return the first row of the result set, if any.

public getRow(string $sql[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>|bool
Parameters
$sql : string

An SQL string with placeholders. The placeholders are assumed to be specific to the database engine for this connection.

$params : array<string|int, mixed> = []

An array of parameters to insert into the SQL string using this connection's escaping mechanism.

Return values
array<string|int, mixed>|bool

$result The first row of the result set, if any, keyed on column name. False if no such result was found.

query()

Run an SQL query with the specified parameters, if any.

public query(string $sql[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
$sql : string

An SQL string with placeholders. The placeholders are assumed to be specific to the database engine for this connection.

$params : array<string|int, mixed> = []

An array of parameters to insert into the SQL string using this connection's escaping mechanism.

Return values
mixed

$result The result of calling this connection's internal query function. The type of result depends on the underlying database engine. This method is usually used when the result of a query is not important, like a DDL query.

rollback()

Performs a rollback on this connection, if supported.

public rollback() : mixed
Return values
mixed

Search results