MDL-14679 dml/native_mysqli recordset cleanup

This commit is contained in:
skodak 2008-10-26 13:00:53 +00:00
parent 3f0c17b8ef
commit 312dab0dec

View file

@ -24,12 +24,12 @@ class mysqli_native_moodle_recordset extends moodle_recordset {
} }
public function current() { public function current() {
return is_null($this->current) ? null : (object)$this->current; return (object)$this->current;
} }
public function key() { public function key() {
/// return first column value as key /// return first column value as key
if (is_null($this->current)) { if (!$this->current) {
return false; return false;
} }
$key = reset($this->current); $key = reset($this->current);
@ -45,7 +45,7 @@ class mysqli_native_moodle_recordset extends moodle_recordset {
} }
public function valid() { public function valid() {
return !is_null($this->current); return !empty($this->current);
} }
public function close() { public function close() {