Permalink
Browse files

gradebook MDL-25713 switched grade_object fetch_all_helper over to us…

…e a recordset
  • Loading branch information...
1 parent 14a4e75 commit 49436db62a2647787d3bf5142c8906a7d0e08113 @andyjdavis andyjdavis committed Dec 20, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/grade/grade_object.php
@@ -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 {

0 comments on commit 49436db

Please sign in to comment.