PHP Класс Doctrine\DBAL\Statement

С версии: 1.0
Автор: Konsta Vesterinen ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$conn Doctrine\DBAL\Connection The connection this statement is bound to and executed on.
$params array The bound parameters.
$platform Doctrine\DBAL\Platforms\AbstractPlatform The underlying database platform.
$sql string The SQL statement.
$stmt Doctrine\DBAL\Driver\Statement The underlying driver statement.
$types array The parameter types.

Открытые методы

Метод Описание
__construct ( string $sql, Doctrine\DBAL\Connection $conn ) Creates a new Statement for the given SQL and Connection.
bindParam ( string $name, mixed &$var, integer $type = PDO::PARAM_STR, integer | null $length = null ) : boolean Binds a parameter to a value by reference.
bindValue ( string $name, mixed $value, mixed $type = null ) : boolean Binds a parameter value to the statement.
closeCursor ( ) : boolean Closes the cursor, freeing the database resources used by this statement.
columnCount ( ) : integer Returns the number of columns in the result set.
errorCode ( ) : string Fetches the SQLSTATE associated with the last operation on the statement.
errorInfo ( ) : array Fetches extended error information associated with the last operation on the statement.
execute ( array | null $params = null ) : boolean Executes the statement with the currently bound parameters.
fetch ( integer | null $fetchMode = null ) : mixed Fetches the next row from a result set.
fetchAll ( integer | null $fetchMode = null, mixed $fetchArgument ) : array Returns an array containing all of the result set rows.
fetchColumn ( integer $columnIndex ) : mixed Returns a single column from the next row of a result set.
getIterator ( ) Required by interface IteratorAggregate.
getWrappedStatement ( ) : Doctrine\DBAL\Driver\Statement Gets the wrapped driver statement.
rowCount ( ) : integer Returns the number of rows affected by the last execution of this statement.
setFetchMode ( $fetchMode, $arg2 = null, $arg3 = null )

Описание методов

__construct() публичный Метод

Creates a new Statement for the given SQL and Connection.
public __construct ( string $sql, Doctrine\DBAL\Connection $conn )
$sql string The SQL of the statement.
$conn Doctrine\DBAL\Connection The connection on which the statement should be executed.

bindParam() публичный Метод

Binding a parameter by reference does not support DBAL mapping types.
public bindParam ( string $name, mixed &$var, integer $type = PDO::PARAM_STR, integer | null $length = null ) : boolean
$name string The name or position of the parameter.
$var mixed The reference to the variable to bind.
$type integer The PDO binding type.
$length integer | null Must be specified when using an OUT bind so that PHP allocates enough memory to hold the returned value.
Результат boolean TRUE on success, FALSE on failure.

bindValue() публичный Метод

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.
public bindValue ( string $name, mixed $value, mixed $type = null ) : boolean
$name string The name or position of the parameter.
$value mixed The value of the parameter.
$type mixed Either a PDO binding type or a DBAL mapping type name or instance.
Результат boolean TRUE on success, FALSE on failure.

closeCursor() публичный Метод

Closes the cursor, freeing the database resources used by this statement.
public closeCursor ( ) : boolean
Результат boolean TRUE on success, FALSE on failure.

columnCount() публичный Метод

Returns the number of columns in the result set.
public columnCount ( ) : integer
Результат integer

errorCode() публичный Метод

Fetches the SQLSTATE associated with the last operation on the statement.
public errorCode ( ) : string
Результат string

errorInfo() публичный Метод

Fetches extended error information associated with the last operation on the statement.
public errorInfo ( ) : array
Результат array

execute() публичный Метод

Executes the statement with the currently bound parameters.
public execute ( array | null $params = null ) : boolean
$params array | null
Результат boolean TRUE on success, FALSE on failure.

fetch() публичный Метод

Fetches the next row from a result set.
public fetch ( integer | null $fetchMode = null ) : mixed
$fetchMode integer | null
Результат mixed The return value of this function on success depends on the fetch type. In all cases, FALSE is returned on failure.

fetchAll() публичный Метод

Returns an array containing all of the result set rows.
public fetchAll ( integer | null $fetchMode = null, mixed $fetchArgument ) : array
$fetchMode integer | null
$fetchArgument mixed
Результат array An array containing all of the remaining rows in the result set.

fetchColumn() публичный Метод

Returns a single column from the next row of a result set.
public fetchColumn ( integer $columnIndex ) : mixed
$columnIndex integer
Результат mixed A single column from the next row of a result set or FALSE if there are no more rows.

getIterator() публичный Метод

public getIterator ( )

getWrappedStatement() публичный Метод

Gets the wrapped driver statement.
public getWrappedStatement ( ) : Doctrine\DBAL\Driver\Statement
Результат Doctrine\DBAL\Driver\Statement

rowCount() публичный Метод

Returns the number of rows affected by the last execution of this statement.
public rowCount ( ) : integer
Результат integer The number of affected rows.

setFetchMode() публичный Метод

public setFetchMode ( $fetchMode, $arg2 = null, $arg3 = null )

Описание свойств

$conn защищенное свойство

The connection this statement is bound to and executed on.
protected Connection,Doctrine\DBAL $conn
Результат Doctrine\DBAL\Connection

$params защищенное свойство

The bound parameters.
protected array $params
Результат array

$platform защищенное свойство

The underlying database platform.
protected AbstractPlatform,Doctrine\DBAL\Platforms $platform
Результат Doctrine\DBAL\Platforms\AbstractPlatform

$sql защищенное свойство

The SQL statement.
protected string $sql
Результат string

$stmt защищенное свойство

The underlying driver statement.
protected Statement,Doctrine\DBAL\Driver $stmt
Результат Doctrine\DBAL\Driver\Statement

$types защищенное свойство

The parameter types.
protected array $types
Результат array