IResult
in
This interface represents the result of a database query.
Usage:
$qb = $this->db->getQueryBuilder();
$qb->select(...);
$result = $query->executeQuery();
foreach ($result->iterateAssociative() as $row) {
$id = $row['id'];
}
Tags
Attributes
- #[Consumable]
- $since: '21.0.0'
Table of Contents
Methods
- closeCursor() : true
- fetch() : PDO::FETCH_NUM ? list : mixed))|false
- fetchAll() : array<int, PDO::FETCH_NUM ? list : mixed))>
- fetchAllAssociative() : array<int, array<string, mixed>>
- Returns an array containing all the result rows represented as associative arrays.
- fetchAllNumeric() : array<int, array<int, mixed>>
- Returns an array containing all the result rows represented as numeric arrays.
- fetchAssociative() : array<string, mixed>|false
- Returns the next row of the result as an associative array or FALSE if there are no more rows.
- fetchColumn() : mixed
- fetchFirstColumn() : array<int, mixed>
- Returns the value of the first column of all rows.
- fetchNumeric() : array<int, mixed>|false
- Returns the next row of the result as a numeric array or FALSE if there are no more rows.
- fetchOne() : false|mixed
- Returns the first value of the next row of the result or FALSE if there are no more rows.
- iterateAssociative() : Traversable<string|int, array<string, mixed>>
- Returns an iterator over rows represented as associative arrays.
- iterateNumeric() : Traversable<string|int, array<int, mixed>>
- Returns an iterator over rows represented as numeric arrays.
- rowCount() : int
Methods
closeCursor()
public
closeCursor() : true
Tags
Return values
truefetch()
public
fetch([PDO::FETCH_* $fetchMode = PDO::FETCH_ASSOC ]) : PDO::FETCH_NUM ? list : mixed))|false
Parameters
- $fetchMode : PDO::FETCH_* = PDO::FETCH_ASSOC
Tags
Return values
PDO::FETCH_NUM ? list : mixed))|falsefetchAll()
public
fetchAll([PDO::FETCH_* $fetchMode = PDO::FETCH_ASSOC ]) : array<int, PDO::FETCH_NUM ? list : mixed))>
Parameters
- $fetchMode : PDO::FETCH_* = PDO::FETCH_ASSOC
Tags
Return values
array<int, PDO::FETCH_NUM ? list : mixed))>fetchAllAssociative()
Returns an array containing all the result rows represented as associative arrays.
public
fetchAllAssociative() : array<int, array<string, mixed>>
Tags
Return values
array<int, array<string, mixed>>fetchAllNumeric()
Returns an array containing all the result rows represented as numeric arrays.
public
fetchAllNumeric() : array<int, array<int, mixed>>
Tags
Return values
array<int, array<int, mixed>>fetchAssociative()
Returns the next row of the result as an associative array or FALSE if there are no more rows.
public
fetchAssociative() : array<string, mixed>|false
Tags
Return values
array<string, mixed>|falsefetchColumn()
public
fetchColumn() : mixed
use \OCP\DB\IResult::fetchOne
Tags
fetchFirstColumn()
Returns the value of the first column of all rows.
public
fetchFirstColumn() : array<int, mixed>
Tags
Return values
array<int, mixed>fetchNumeric()
Returns the next row of the result as a numeric array or FALSE if there are no more rows.
public
fetchNumeric() : array<int, mixed>|false
Tags
Return values
array<int, mixed>|falsefetchOne()
Returns the first value of the next row of the result or FALSE if there are no more rows.
public
fetchOne() : false|mixed
Tags
Return values
false|mixediterateAssociative()
Returns an iterator over rows represented as associative arrays.
public
iterateAssociative() : Traversable<string|int, array<string, mixed>>
Tags
Return values
Traversable<string|int, array<string, mixed>>iterateNumeric()
Returns an iterator over rows represented as numeric arrays.
public
iterateNumeric() : Traversable<string|int, array<int, mixed>>
Tags
Return values
Traversable<string|int, array<int, mixed>>rowCount()
public
rowCount() : int