Commit 2f9ea7d7 authored by andyjdavis's avatar andyjdavis
Browse files

gradebook MDL-25713 switched grade_object fetch_all_helper() over to using a recordset

parent 88e5c586
......@@ -184,20 +184,21 @@ abstract class grade_object {
}
global $DB;
if ($datas = $DB->get_records_select($table, $wheresql, $newparams)) {
$result = array();
foreach($datas as $data) {
$instance = new $classname();
grade_object::set_properties($instance, $data);
$result[$instance->id] = $instance;
}
return $result;
} else {
$rs = $DB->get_recordset_select($table, $wheresql, $newparams);
//returning false rather than empty array if nothing found
if (!$rs->valid()) {
return false;
}
return false;
$result = array();
foreach($rs as $data) {
$instance = new $classname();
grade_object::set_properties($instance, $data);
$result[$instance->id] = $instance;
}
$rs->close();
return $result;
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment