Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
question_test_recordset Class Reference

Simple class that implements the moodle_recordset API based on an array of test data. More...

Inheritance diagram for question_test_recordset:
moodle_recordset

Public Member Functions

 __construct (array $table)
 Constructor.
 
 close ()
 Did we reach the end?
 
 current ()
 
 key ()
 
 next ()
 
 rewind ()
 Returns current record - fields as object properties, lowercase.
 
 valid ()
 

Protected Attributes

 $records
 

Detailed Description

Simple class that implements the moodle_recordset API based on an array of test data.

See the question_attempt_step_db_test class in question/engine/tests/testquestionattemptstep.php for an example of how this is used.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

question_test_recordset::__construct ( array $table)

Constructor.

Parameters
$tableas for testing_db_record_builder::build_db_records() but does not need a unique first column.

Member Function Documentation

◆ close()

question_test_recordset::close ( )

Did we reach the end?

Return values
booleanFree resources and connections, recordset can not be used anymore.
void

Reimplemented from moodle_recordset.

◆ rewind()

moodle_recordset::rewind ( )
inherited

Returns current record - fields as object properties, lowercase.

Return values
objectReturns the key of current row
intcurrent row Moves forward to next row
voidRewinds are not supported!
void

The documentation for this class was generated from the following file: