Merge "Don't fallback from uk to ru"
[lhc/web/wiklou.git] / includes / utils / BatchRowIterator.php
index 602587c..ef2c14a 100644 (file)
@@ -77,6 +77,11 @@ class BatchRowIterator implements RecursiveIterator {
         */
        private $key;
 
+       /**
+        * @var array Additional query options
+        */
+       protected $options = [];
+
        /**
         * @param IDatabase $db The database to read from
         * @param string|array $table      The name or names of the table to read from
@@ -104,6 +109,14 @@ class BatchRowIterator implements RecursiveIterator {
                $this->conditions = array_merge( $this->conditions, $conditions );
        }
 
+       /**
+        * @param array $options Query options suitable for use with
+        *  IDatabase::select
+        */
+       public function addOptions( array $options ) {
+               $this->options = array_merge( $this->options, $options );
+       }
+
        /**
         * @param array $conditions Query join conditions suitable for use
         *  with IDatabase::select
@@ -199,7 +212,7 @@ class BatchRowIterator implements RecursiveIterator {
                        [
                                'LIMIT' => $this->batchSize,
                                'ORDER BY' => $this->orderBy,
-                       ],
+                       ] + $this->options,
                        $this->joinConditions
                );