Merge "Made findMissingFiles inspect the destination title for moves"
[lhc/web/wiklou.git] / includes / db / ORMResult.php
index 1e6b83d..327d20d 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 /**
- * Result of a ORMTable::select, which returns IORMRow objects.
+ * ORMIterator that takes a ResultWrapper object returned from
+ * a select operation returning IORMRow objects (ie IORMTable::select).
+ *
+ * Documentation inline and at https://www.mediawiki.org/wiki/Manual:ORMTable
  *
  * 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
  * @file ORMResult.php
  * @ingroup ORM
  *
- * @licence GNU GPL v2 or later
+ * @license GNU GPL v2 or later
  * @author Jeroen De Dauw < jeroendedauw@gmail.com >
  */
 
-class ORMResult implements Iterator {
-
+class ORMResult implements ORMIterator {
        /**
         * @var ResultWrapper
         */
        protected $res;
 
        /**
-        * @var integer
+        * @var int
         */
-       protected  $key;
+       protected $key;
 
        /**
         * @var IORMRow
@@ -60,25 +62,25 @@ class ORMResult implements Iterator {
        }
 
        /**
-        * @param $row
+        * @param bool|object $row
         */
        protected function setCurrent( $row ) {
                if ( $row === false ) {
                        $this->current = false;
                } else {
-                       $this->current = $this->table->newFromDBResult( $row );
+                       $this->current = $this->table->newRowFromDBResult( $row );
                }
        }
 
        /**
-        * @return integer
+        * @return int
         */
        public function count() {
                return $this->res->numRows();
        }
 
        /**
-        * @return boolean
+        * @return bool
         */
        public function isEmpty() {
                return $this->res->numRows() === 0;
@@ -92,7 +94,7 @@ class ORMResult implements Iterator {
        }
 
        /**
-        * @return integer
+        * @return int
         */
        public function key() {
                return $this->key;
@@ -111,10 +113,9 @@ class ORMResult implements Iterator {
        }
 
        /**
-        * @return boolean
+        * @return bool
         */
        public function valid() {
                return $this->current !== false;
        }
-
 }