MDL-14679 dml/native_mysqli recordset cleanup
authorskodak <skodak>
Sun, 26 Oct 2008 13:00:53 +0000 (13:00 +0000)
committerskodak <skodak>
Sun, 26 Oct 2008 13:00:53 +0000 (13:00 +0000)
lib/dml/mysqli_native_moodle_recordset.php

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