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
Table of Contents
Interfaces
- IResultSet
- Countable
- Iterator
Properties
- $row : array<string|int, mixed>|null
Methods
- __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
__get()
Returns a column of the actual row
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
__isset()
public
__isset(mixed $name) : mixed
Parameters
- $name : mixed
count()
Returns the count of the found rows of the db
public
count() : int
Return values
intcurrent()
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
IResultSetgetNamespace()
public
getNamespace() : mixed
hasColumns()
Returns true if there are columns in the selected namespace other than id
public
hasColumns() : bool
Tags
Return values
boolkey()
public
key() : mixed
next()
public
next() : 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
ResultSetresetNodes()
Resets the join path stack.
public
resetNodes() : ResultSet
Using properties via __get calls return the columns of the selected join path.
Return values
ResultSetrewind()
public
rewind() : 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
ResultSetvalid()
public
valid() : bool