Result
class Result implements IDataSource
Query result.
Properties
int read-only | $rowCount |
Methods
Frees the resources allocated for this result set.
Safe access to property $driver.
Moves cursor position without fetching row.
Required by the Countable interface.
Returns the number of rows in a result set.
Required by the IteratorAggregate interface.
Returns the number of columns in a result set.
Set fetched object class. This class should extend the Row class.
Returns fetched object class name.
Set a factory to create fetched object instances. These should extend the Row class.
Like fetch(), but returns only first field.
Fetches all records from table.
Fetches all records from table and returns associative tree.
Fetches all records from table like $key => $value pairs.
Returns column type.
Returns columns type.
Sets type formats.
Returns data format.
No description
Displays complete result set as HTML or text table for debug purposes.
Details
at line 44
__construct(ResultDriver $driver, bool $normalize = true)
No description
at line 56
final void
free()
Frees the resources allocated for this result set.
at line 69
final ResultDriver
getResultDriver()
Safe access to property $driver.
at line 86
final bool
seek(int $row)
Moves cursor position without fetching row.
at line 97
final int
count()
Required by the Countable interface.
at line 106
final int
getRowCount()
Returns the number of rows in a result set.
at line 115
final ResultIterator
getIterator()
Required by the IteratorAggregate interface.
at line 124
final int
getColumnCount()
Returns the number of columns in a result set.
at line 136
Result
setRowClass(string|null $class)
Set fetched object class. This class should extend the Row class.
at line 146
string|null
getRowClass()
Returns fetched object class name.
at line 155
Result
setRowFactory(callable $callback)
Set a factory to create fetched object instances. These should extend the Row class.
at line 167
final Row|array|null
fetch()
Fetches the row at current position, process optional type conversion.
and moves the internal cursor to the next position
at line 190
final mixed
fetchSingle()
Like fetch(), but returns only first field.
at line 207
final array
fetchAll(int|null $offset = null, int|null $limit = null)
Fetches all records from table.
at line 239
final array
fetchAssoc(string $assoc)
Fetches all records from table and returns associative tree.
Examples:
- associative descriptor: col1[]col2->col3 builds a tree: $tree[$val1][$index][$val2]->col3[$val3] = {record}
- associative descriptor: col1|col2->col3=col4 builds a tree: $tree[$val1][$val2]->col3[$val3] = val4
at line 380
final array
fetchPairs(string|null $key = null, string|null $value = null)
Fetches all records from table like $key => $value pairs.
at line 532
final Result
setType(string $column, string|null $type)
Define column type.
at line 542
final string|null
getType(string $column)
Returns column type.
at line 551
final array
getTypes()
Returns columns type.
at line 560
final Result
setFormat(string $type, string|null $format)
Sets type format.
at line 570
final Result
setFormats(array $formats)
Sets type formats.
at line 580
final string|null
getFormat(string $type)
Returns data format.
at line 592
Result
getInfo()
Returns a meta information about the current result set.
at line 603
final array
getColumns()
No description
at line 615
final void
dump()
Displays complete result set as HTML or text table for debug purposes.
Traits
Better OOP experience.