Merge "deleteEqualMessages: Exclude messages that are empty by default"
[lhc/web/wiklou.git] / includes / db / DatabaseUtility.php
index eacebcf..de58bab 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * This file contains database-related utiliy classes.
+ * This file contains database-related utility classes.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -138,7 +138,7 @@ class ResultWrapper implements Iterator {
 
        /**
         * Fetch the next row from the given result object, in associative array
-        * form.  Fields are retrieved with $row['fieldname'].
+        * form. Fields are retrieved with $row['fieldname'].
         *
         * @return Array
         * @throws DBUnexpectedError Thrown if the database returns an error
@@ -219,9 +219,9 @@ class ResultWrapper implements Iterator {
  * doesn't go anywhere near an actual database.
  */
 class FakeResultWrapper extends ResultWrapper {
-       var $result     = array();
-       var $db         = null; // And it's going to stay that way :D
-       var $pos        = 0;
+       var $result = array();
+       var $db = null; // And it's going to stay that way :D
+       var $pos = 0;
        var $currentRow = null;
 
        function __construct( $array ) {
@@ -242,14 +242,19 @@ class FakeResultWrapper extends ResultWrapper {
                        $this->currentRow = false;
                }
                $this->pos++;
-               return $this->currentRow;
+               if ( is_object( $this->currentRow ) ) {
+                       return get_object_vars( $this->currentRow );
+               } else {
+                       return $this->currentRow;
+               }
        }
 
        function seek( $row ) {
                $this->pos = $row;
        }
 
-       function free() {}
+       function free() {
+       }
 
        // Callers want to be able to access fields with $this->fieldName
        function fetchObject() {
@@ -281,7 +286,7 @@ class LikeMatch {
        /**
         * Store a string into a LikeMatch marker object.
         *
-        * @param String $s
+        * @param string $s
         */
        public function __construct( $s ) {
                $this->str = $s;
@@ -302,4 +307,3 @@ class LikeMatch {
  */
 interface DBMasterPos {
 }
-