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
Afficher le fichier Open project: gabordemooij/redbean Interface Usage Examples

Méthodes publiques

Méthode 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 méthode

Closes database connection.
public close ( ) : void
Résultat void

commit() public méthode

Commits the transaction.
public commit ( ) : void
Résultat void

exec() public méthode

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
Résultat void

get() public méthode

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
Résultat array

getAffectedRows() public méthode

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

getAssoc() public méthode

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
Résultat array

getAssocRow() public méthode

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
Résultat array

getCell() public méthode

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
Résultat string

getCol() public méthode

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
Résultat array

getCursor() public méthode

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
Résultat redbeanphp\Cursor

getDatabase() public méthode

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
Résultat mixed

getInsertID() public méthode

Returns the latest insert ID.
public getInsertID ( ) : integer
Résultat integer

getRow() public méthode

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
Résultat array

getSQL() public méthode

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

rollback() public méthode

Rolls back the transaction.
public rollback ( ) : void
Résultat void

startTransaction() public méthode

Starts a transaction.
public startTransaction ( ) : void
Résultat void