Skip to content

Commit

Permalink
Merge branch 'MDL-25713_recordset' of git://github.com/andyjdavis/moo…
Browse files Browse the repository at this point in the history
…dle into MOODLE_19_STABLE
  • Loading branch information
skodak committed Dec 27, 2010
2 parents 535037f + 49436db commit 76035b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/grade/grade_object.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,14 @@ function fetch_all_helper($table, $classname, $params) {
$wheresql = implode("AND", $wheresql);
}

if ($datas = get_records_select($table, $wheresql, 'id')) {
if ($rs = get_recordset_select($table, $wheresql, 'id')) {
$result = array();
foreach($datas as $data) {
while ($data = rs_fetch_next_record($rs)) {
$instance = new $classname();
grade_object::set_properties($instance, $data);
$result[$instance->id] = $instance;
}
rs_close($rs);
return $result;

} else {
Expand Down

0 comments on commit 76035b1

Please sign in to comment.