ResultSet
in package
implements
IResultSet, Countable, Iterator
A ResultSet from the Database.
This implementation basically contains a mysqli_result returned from the query. Columns can be accessed through __get method, but they are namespaced. Every Join from the query gives a namespace, namespaces can be nested
Tags
Interfaces, Classes, Traits and Enums
- IResultSet
- Countable
- Iterator
Table of Contents
- $row : array<string|int, mixed>|null
- __construct() : mixed
- __get() : mixed
- Returns a column of the actual row
- __isset() : mixed
- count() : int
- Returns the count of the found rows of the db
- current() : array<string|int, mixed>
- extractNode() : IResultSet
- getNamespace() : mixed
- hasColumns() : bool
- Returns true if there are columns in the selected namespace other than id
- key() : mixed
- next() : void
- popNode() : ResultSet
- Pops a node off of the join path stack.
- resetNodes() : ResultSet
- Resets the join path stack.
- rewind() : void
- selectNode() : ResultSet
- Adds a node on top of the join path stack.
- valid() : bool
Properties
$row
protected
array<string|int, mixed>|null
$row
= []
Methods
__construct()
public
__construct(mysqli_result $resultSet, IQuery $query) : mixed
Parameters
- $resultSet : mysqli_result
- $query : IQuery
Return values
mixed —__get()
Returns a column of the actual row
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —__isset()
public
__isset(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —count()
Returns the count of the found rows of the db
public
count() : int
Return values
int —current()
public
current() : array<string|int, mixed>
Return values
array<string|int, mixed> —extractNode()
public
extractNode(string $join[, string|null $idColumn = null ]) : IResultSet
Parameters
- $join : string
- $idColumn : string|null = null
Return values
IResultSet —getNamespace()
public
getNamespace() : mixed
Return values
mixed —hasColumns()
Returns true if there are columns in the selected namespace other than id
public
hasColumns() : bool
Tags
Return values
bool —key()
public
key() : mixed
Return values
mixed —next()
public
next() : void
Return values
void —popNode()
Pops a node off of the join path stack.
public
popNode() : ResultSet
Using properties via __get calls return the columns of the selected join path.
Use ResultSet::selectNode() to push a node on top and ResultSet::resetNodes()
to remove all
Return values
ResultSet —resetNodes()
Resets the join path stack.
public
resetNodes() : ResultSet
Using properties via __get calls return the columns of the selected join path.
Return values
ResultSet —rewind()
public
rewind() : void
Return values
void —selectNode()
Adds a node on top of the join path stack.
public
selectNode(string $join) : ResultSet
Using properties via __get calls return the columns of the selected join path.
Use ResultSet::popNode() to pop the last added node and ResultSet::resetNodes()
to remove all
Parameters
- $join : string
Return values
ResultSet —valid()
public
valid() : bool