Doctrine


Doctrine\DBAL\Statement
/Doctrine/DBAL/Statement.php at line 35

Class Statement

Statement

public class Statement

A thin wrapper around a Doctrine\DBAL\Driver\Statement that adds support for logging, DBAL mapping types, etc.

Author:
Roman Borschel
Since:
2.0

Constructor Summary

Statement(string sql, mixed conn, Doctrine\DBAL\Connection The)

Creates a new Statement for the given SQL and Connection.

Method Summary
boolean

bindParam(string name, mixed var, integer type, mixed value)

Binds a parameter to a value by reference.

boolean

bindValue(mixed name, mixed value, mixed type, $value The)

Binds a parameter value to the statement.

boolean

closeCursor()

Closes the cursor, freeing the database resources used by this statement.

integer

columnCount()

Returns the number of columns in the result set.

string

errorCode()

Fetches the SQLSTATE associated with the last operation on the statement.

array

errorInfo()

Fetches extended error information associated with the last operation on the statement.

boolean

execute(mixed params)

Executes the statement with the currently bound parameters.

mixed

fetch(integer fetchStyle)

Fetches the next row from a result set.

array

fetchAll(integer fetchStyle, integer columnIndex)

Returns an array containing all of the result set rows.

mixed

fetchColumn(integer columnIndex)

Returns a single column from the next row of a result set.

Doctrine\DBAL\Driver\Statement

getWrappedStatement()

Gets the wrapped driver statement.

integer

rowCount()

Returns the number of rows affected by the last execution of this statement.

Constructor Detail

/Doctrine/DBAL/Statement.php at line 64

Statement

public Statement(string sql, mixed conn, Doctrine\DBAL\Connection The)

Creates a new Statement for the given SQL and Connection.

Parameters:
sql - The SQL of the statement.
The - connection on which the statement should be executed.

Method Detail

/Doctrine/DBAL/Statement.php at line 114

bindParam

public boolean bindParam(string name, mixed var, integer type, mixed value)

Binds a parameter to a value by reference.

Binding a parameter by reference does not support DBAL mapping types.

Parameters:
name - The name or position of the parameter.
value - The reference to the variable to bind
type - The PDO binding type.
Returns:
TRUE on success, FALSE on failure.

/Doctrine/DBAL/Statement.php at line 85

bindValue

public boolean bindValue(mixed name, mixed value, mixed type, $value The)

Binds a parameter value to the statement.

The value can optionally be bound with a PDO binding type or a DBAL mapping type. If bound with a DBAL mapping type, the binding type is derived from the mapping type and the value undergoes the conversion routines of the mapping type before being bound.

Parameters:
The - name or position of the parameter.
The - value of the parameter.
type - Either a PDO binding type or a DBAL mapping type name or instance.
Returns:
TRUE on success, FALSE on failure.

/Doctrine/DBAL/Statement.php at line 138

closeCursor

public boolean closeCursor()

Closes the cursor, freeing the database resources used by this statement.

Returns:
TRUE on success, FALSE on failure.

/Doctrine/DBAL/Statement.php at line 148

columnCount

public integer columnCount()

Returns the number of columns in the result set.


/Doctrine/DBAL/Statement.php at line 158

errorCode

public string errorCode()

Fetches the SQLSTATE associated with the last operation on the statement.


/Doctrine/DBAL/Statement.php at line 168

errorInfo

public array errorInfo()

Fetches extended error information associated with the last operation on the statement.


/Doctrine/DBAL/Statement.php at line 124

execute

public boolean execute(mixed params)

Executes the statement with the currently bound parameters.

Returns:
TRUE on success, FALSE on failure.

/Doctrine/DBAL/Statement.php at line 180

fetch

public mixed fetch(integer fetchStyle)

Fetches the next row from a result set.

Returns:
The return value of this function on success depends on the fetch type. In all cases, FALSE is returned on failure.

/Doctrine/DBAL/Statement.php at line 192

fetchAll

public array fetchAll(integer fetchStyle, integer columnIndex)

Returns an array containing all of the result set rows.

Returns:
An array containing all of the remaining rows in the result set.

/Doctrine/DBAL/Statement.php at line 206

fetchColumn

public mixed fetchColumn(integer columnIndex)

Returns a single column from the next row of a result set.

Returns:
A single column from the next row of a result set or FALSE if there are no more rows.

/Doctrine/DBAL/Statement.php at line 226

getWrappedStatement

public Doctrine\DBAL\Driver\Statement getWrappedStatement()

Gets the wrapped driver statement.


/Doctrine/DBAL/Statement.php at line 216

rowCount

public integer rowCount()

Returns the number of rows affected by the last execution of this statement.

Returns:
The number of affected rows.

Doctrine