DatabaseIterator
Implements Countable, IteratorJoomla Framework Database Driver Class
since |
1.0 |
---|---|
package |
Joomla Framework |
Methods
__construct
Database iterator constructor.
__construct(\Joomla\Database\StatementInterface statement, string column = null, string class = stdClass::class) : mixed
since |
1.0 |
---|---|
throws |
|
Arguments
- statement
\Joomla\Database\StatementInterface
The statement holding the result set to iterate.- column
string
An option column to use as the iterator key.- class
string
The class of object that is returned.
Response
mixed
__destruct
Database iterator destructor.
__destruct() : mixed
since |
1.0 |
---|
Response
mixed
count
Get the number of rows in the result set for the executed SQL given by the cursor.
count() : int
see | Countable::count() |
---|---|
since |
1.0 |
Response
int
The number of rows in the result set.
current
The current element in the iterator.
current() : object
see | Iterator::current() |
---|---|
since |
1.0 |
Response
object
fetchObject
Method to fetch a row from the result set cursor as an object.
fetchObject() : mixed
since |
1.0 |
---|
Response
mixed
Either the next row from the result set or false if there are no more rows.
freeResult
Method to free up the memory used for the result set.
freeResult() : void
since |
1.0 |
---|
key
The key of the current element in the iterator.
key() : scalar
see | Iterator::key() |
---|---|
since |
1.0 |
Response
scalar
next
Moves forward to the next result from the SQL query.
next() : void
see | Iterator::next() |
---|---|
since |
1.0 |
rewind
Rewinds the iterator.
rewind() : void
This iterator cannot be rewound.
see | Iterator::rewind() |
---|---|
since |
1.0 |
valid
Checks if the current position of the iterator is valid.
valid() : bool
see | Iterator::valid() |
---|---|
since |
1.0 |
Response
bool
Properties
class
The class of object to create.
since |
1.0 |
---|
Type(s)
string
column
The name of the column to use for the key of the database record.
since |
1.0 |
---|
Type(s)
mixed
current
The current database record.
since |
1.0 |
---|
Type(s)
mixed
key
A numeric or string key for the current database record.
since |
1.0 |
---|
Type(s)
scalar
fetched
The number of fetched records.
since |
1.0 |
---|
Type(s)
int
statement
The statement holding the result set to iterate.
since |
1.0 |
---|
Type(s)
\Joomla\Database\StatementInterface