StatementInterface
in
Common interface for database statement wrappers
This interface defines the standard methods that all statement classes must implement to provide compatibility with code that expects a Zend_Db_Statement-like interface.
Table of Contents
Constants
- FETCH_ASSOC : mixed = 2
- FETCH_COLUMN : mixed = 7
- FETCH_KEY_PAIR : mixed = 12
- FETCH_NUM : mixed = 3
Methods
- closeCursor() : bool
- Closes the cursor, allowing the statement to be executed again
- columnCount() : int
- Returns the number of columns in the result set
- fetch() : array<string|int, mixed>|false
- Fetch a row from the result set
- fetchAll() : array<int, array<string|int, mixed>|mixed>
- Fetch all rows from the result set
- fetchColumn() : mixed
- Fetch a single column from the next row
- fetchObject() : object|false
- Fetch an object from the result set
- getResult() : Result
- Get the Doctrine DBAL Result object
- rowCount() : int
- Return the number of rows affected by the last statement
Constants
FETCH_ASSOC
public
mixed
FETCH_ASSOC
= 2
FETCH_COLUMN
public
mixed
FETCH_COLUMN
= 7
FETCH_KEY_PAIR
public
mixed
FETCH_KEY_PAIR
= 12
FETCH_NUM
public
mixed
FETCH_NUM
= 3
Methods
closeCursor()
Closes the cursor, allowing the statement to be executed again
public
closeCursor() : bool
Return values
boolcolumnCount()
Returns the number of columns in the result set
public
columnCount() : int
Return values
intfetch()
Fetch a row from the result set
public
fetch([int $fetchMode = self::FETCH_ASSOC ]) : array<string|int, mixed>|false
Parameters
- $fetchMode : int = self::FETCH_ASSOC
-
One of self::FETCH_* constants
Return values
array<string|int, mixed>|falsefetchAll()
Fetch all rows from the result set
public
fetchAll([int $fetchMode = self::FETCH_ASSOC ][, int $col = 0 ]) : array<int, array<string|int, mixed>|mixed>
Parameters
- $fetchMode : int = self::FETCH_ASSOC
-
One of self::FETCH_* constants
- $col : int = 0
-
Column index (used for FETCH_COLUMN)
Return values
array<int, array<string|int, mixed>|mixed>fetchColumn()
Fetch a single column from the next row
public
fetchColumn([int $col = 0 ]) : mixed
Parameters
- $col : int = 0
fetchObject()
Fetch an object from the result set
public
fetchObject([string $class = 'stdClass' ][, array<int, mixed> $config = [] ]) : object|false
Parameters
- $class : string = 'stdClass'
- $config : array<int, mixed> = []
Return values
object|falsegetResult()
Get the Doctrine DBAL Result object
public
getResult() : Result
Return values
ResultrowCount()
Return the number of rows affected by the last statement
public
rowCount() : int