Statement
class Statement implements IteratorAggregate, Statement (View source)
A thin wrapper around a Doctrine\DBAL\Driver\Statement that adds support for logging, DBAL mapping types, etc.
Properties
protected string | $sql | The SQL statement. | |
protected mixed[] | $params | The bound parameters. | |
protected int[]|string[] | $types | The parameter types. | |
protected Statement | $stmt | The underlying driver statement. | |
protected AbstractPlatform | $platform | The underlying database platform. | |
protected Connection | $conn | The connection this statement is bound to and executed on. |
Methods
Creates a new Statement for the given SQL and Connection.
Binds a parameter value to the statement.
Binds a parameter to a value by reference.
Executes the statement with the currently bound parameters.
Closes the cursor, freeing the database resources used by this statement.
Returns the number of columns in the result set.
Fetches the SQLSTATE associated with the last operation on the statement.
Fetches extended error information associated with the last operation on the statement handle.
Sets the fetch mode to use while iterating this statement.
Required by interface IteratorAggregate.
Returns the next row of a result set.
Returns an array containing all of the result set rows.
Returns a single column from the next row of a result set or FALSE if there are no more rows.
Returns the number of rows affected by the last execution of this statement.
Gets the wrapped driver statement.
Details
at line 68
__construct(string $sql, Connection $conn)
Creates a new Statement for the given SQL and Connection.
at line 90
bool
bindValue(string|int $name, mixed $value, int $type = ParameterType::STRING)
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.
at line 124
bool
bindParam(string|int $name, mixed $var, int|null $type = ParameterType::STRING, int|null $length = null)
Binds a parameter to a value by reference.
Binding a parameter by reference does not support DBAL mapping types.
at line 141
bool
execute(mixed[]|null $params = null)
Executes the statement with the currently bound parameters.
at line 180
bool
closeCursor()
Closes the cursor, freeing the database resources used by this statement.
at line 190
int
columnCount()
Returns the number of columns in the result set.
at line 200
string|int|bool
errorCode()
Fetches the SQLSTATE associated with the last operation on the statement.
at line 208
mixed[]
errorInfo()
Fetches extended error information associated with the last operation on the statement handle.
at line 216
bool
setFetchMode(int $fetchMode, mixed $arg2 = null, mixed $arg3 = null)
Sets the fetch mode to use while iterating this statement.
at line 232
getIterator()
Required by interface IteratorAggregate.
{@inheritdoc}
at line 240
mixed
fetch(int|null $fetchMode = null, int $cursorOrientation = PDO::FETCH_ORI_NEXT, int $cursorOffset = 0)
Returns the next row of a result set.
at line 248
mixed[]
fetchAll(int|null $fetchMode = null, int|null $fetchArgument = null, mixed[]|null $ctorArgs = null)
Returns an array containing all of the result set rows.
at line 260
mixed|false
fetchColumn(int $columnIndex = 0)
Returns a single column from the next row of a result set or FALSE if there are no more rows.
at line 270
int
rowCount()
Returns the number of rows affected by the last execution of this statement.