◆ __construct()
core\dml\recordset_walk::__construct |
( |
\moodle_recordset |
$recordset, |
|
|
callable |
$callback, |
|
|
|
$callbackextra = null |
|
) |
| |
Create a new iterator applying the callback to each record.
- Parameters
-
moodle_recordset | $recordset | Recordset to iterate. |
callable | $callback | Apply this function to each record. If using a method, it should be public. |
mixed | $callbackextra | An extra single parameter to pass to the callback. Use a container to pass multiple values. |
◆ __destruct()
core\dml\recordset_walk::__destruct |
( |
| ) |
|
Closes the recordset.
- Return values
-
◆ close()
core\dml\recordset_walk::close |
( |
| ) |
|
Closes the recordset.
- Return values
-
◆ current()
core\dml\recordset_walk::current |
( |
| ) |
|
Returns the current element after applying the callback.
- Return values
-
mixed|bool | The returned value type will depend on the callback. |
◆ key()
core\dml\recordset_walk::key |
( |
| ) |
|
Returns current record key.
- Return values
-
◆ next()
core\dml\recordset_walk::next |
( |
| ) |
|
Moves the internal pointer to the next record.
- Return values
-
◆ rewind()
core\dml\recordset_walk::rewind |
( |
| ) |
|
Rewind is not supported.
- Return values
-
◆ valid()
core\dml\recordset_walk::valid |
( |
| ) |
|
Returns whether the current position is valid or not.
If we reached the end of the recordset we close as we don't allow rewinds. Doing do so we reduce the chance of unclosed recordsets.
- Return values
-
The documentation for this class was generated from the following file: