PHP Interface RedBeanPHP\Adapter

Describes the API for a RedBeanPHP Database Adapter. This interface defines the API contract for a RedBeanPHP Database Adapter.
Author: Gabor de Mooij and the RedBeanPHP Community
Show file Open project: gabordemooij/redbean Interface Usage Examples

Public Methods

Method Description
close ( ) : void Closes database connection.
commit ( ) : void This method is part of the RedBean Transaction Management mechanisms.
exec ( string $sql, array $bindings = [], boolean $noevent = FALSE ) : void Executes an SQL Statement using an array of values to bind If $noevent is TRUE then this function will not signal its observers to notify about the SQL execution; this to prevent infinite recursion when using observers.
get ( string $sql, array $bindings = [] ) : array Executes an SQL Query and returns a resultset.
getAffectedRows ( ) : integer Returns the number of rows that have been affected by the last update statement.
getAssoc ( string $sql, array $bindings = [] ) : array Executes the SQL query specified in $sql and takes the first two columns of the resultset. This function transforms the resultset into an associative array. Values from the the first column will serve as keys while the values of the second column will be used as values.
getAssocRow ( string $sql, array $bindings = [] ) : array Executes the SQL query specified in $sql and indexes the row by the first column.
getCell ( string $sql, array $bindings = [] ) : string Executes an SQL Query and returns a resultset.
getCol ( string $sql, array $bindings = [] ) : array Executes an SQL Query and returns a resultset.
getCursor ( string $sql, array $bindings = [] ) : redbeanphp\Cursor Returns a database agnostic Cursor object.
getDatabase ( ) : mixed Returns the original database resource. This is useful if you want to perform operations on the driver directly instead of working with the adapter. RedBean will only access the adapter and never to talk directly to the driver though.
getInsertID ( ) : integer Returns the latest insert ID.
getRow ( string $sql, array $bindings = [] ) : array Executes an SQL Query and returns a resultset.
getSQL ( ) : string Should returns a string containing the most recent SQL query that has been processed by the adapter.
rollback ( ) : void This method is part of the RedBean Transaction Management mechanisms.
startTransaction ( ) : void This method is part of the RedBean Transaction Management mechanisms.

Method Details

close() public method

Closes database connection.
public close ( ) : void
return void

commit() public method

Commits the transaction.
public commit ( ) : void
return void

exec() public method

Executes an SQL Statement using an array of values to bind If $noevent is TRUE then this function will not signal its observers to notify about the SQL execution; this to prevent infinite recursion when using observers.
public exec ( string $sql, array $bindings = [], boolean $noevent = FALSE ) : void
$sql string string containing SQL code for database
$bindings array array of values to bind to parameters in query string
$noevent boolean no event firing
return void

get() public method

This method returns a multi dimensional resultset similar to getAll The values array can be used to bind values to the place holders in the SQL query.
public get ( string $sql, array $bindings = [] ) : array
$sql string string containing SQL code for database
$bindings array array of values to bind to parameters in query string
return array

getAffectedRows() public method

Returns the number of rows that have been affected by the last update statement.
public getAffectedRows ( ) : integer
return integer

getAssoc() public method

The values array can be used to bind values to the place holders in the SQL query.
public getAssoc ( string $sql, array $bindings = [] ) : array
$sql string string containing SQL code for database
$bindings array array of values to bind to parameters in query string
return array

getAssocRow() public method

Executes the SQL query specified in $sql and indexes the row by the first column.
public getAssocRow ( string $sql, array $bindings = [] ) : array
$sql string Sstring containing SQL code for databaseQL
$bindings array values to bind
return array

getCell() public method

This method returns a single cell, a scalar value as the resultset. The values array can be used to bind values to the place holders in the SQL query.
public getCell ( string $sql, array $bindings = [] ) : string
$sql string string containing SQL code for database
$bindings array array of values to bind to parameters in query string
return string

getCol() public method

This method returns a single column (one array) resultset. The values array can be used to bind values to the place holders in the SQL query.
public getCol ( string $sql, array $bindings = [] ) : array
$sql string string containing SQL code for database
$bindings array array of values to bind to parameters in query string
return array

getCursor() public method

Returns a database agnostic Cursor object.
public getCursor ( string $sql, array $bindings = [] ) : redbeanphp\Cursor
$sql string string containing SQL code for database
$bindings array array of values to bind to parameters in query string
return redbeanphp\Cursor

getDatabase() public method

Returns the original database resource. This is useful if you want to perform operations on the driver directly instead of working with the adapter. RedBean will only access the adapter and never to talk directly to the driver though.
public getDatabase ( ) : mixed
return mixed

getInsertID() public method

Returns the latest insert ID.
public getInsertID ( ) : integer
return integer

getRow() public method

This method returns a single row (one array) resultset. The values array can be used to bind values to the place holders in the SQL query.
public getRow ( string $sql, array $bindings = [] ) : array
$sql string string containing SQL code for database
$bindings array array of values to bind to parameters in query string
return array

getSQL() public method

Should returns a string containing the most recent SQL query that has been processed by the adapter.
public getSQL ( ) : string
return string

rollback() public method

Rolls back the transaction.
public rollback ( ) : void
return void

startTransaction() public method

Starts a transaction.
public startTransaction ( ) : void
return void