Merge "Add a composer.local.json-sample"
[lhc/web/wiklou.git] / includes / utils / BatchRowIterator.php
index 9441608..07cb2bc 100644 (file)
@@ -26,7 +26,7 @@
 class BatchRowIterator implements RecursiveIterator {
 
        /**
-        * @var DatabaseBase $db The database to read from
+        * @var IDatabase $db The database to read from
         */
        protected $db;
 
@@ -58,7 +58,7 @@ class BatchRowIterator implements RecursiveIterator {
 
        /**
         * @var array $fetchColumns List of column names to select from the
-        *  table suitable for use with DatabaseBase::select()
+        *  table suitable for use with IDatabase::select()
         */
        protected $fetchColumns;
 
@@ -78,19 +78,19 @@ class BatchRowIterator implements RecursiveIterator {
        private $key;
 
        /**
-        * @param DatabaseBase $db         The database to read from
+        * @param IDatabase $db The database to read from
         * @param string       $table      The name of the table to read from
         * @param string|array $primaryKey The name or names of the primary key columns
         * @param integer      $batchSize  The number of rows to fetch per iteration
         * @throws MWException
         */
-       public function __construct( DatabaseBase $db, $table, $primaryKey, $batchSize ) {
+       public function __construct( IDatabase $db, $table, $primaryKey, $batchSize ) {
                if ( $batchSize < 1 ) {
                        throw new MWException( 'Batch size must be at least 1 row.' );
                }
                $this->db = $db;
                $this->table = $table;
-               $this->primaryKey = (array) $primaryKey;
+               $this->primaryKey = (array)$primaryKey;
                $this->fetchColumns = $this->primaryKey;
                $this->orderBy = implode( ' ASC,', $this->primaryKey ) . ' ASC';
                $this->batchSize = $batchSize;
@@ -98,7 +98,7 @@ class BatchRowIterator implements RecursiveIterator {
 
        /**
         * @param array $condition Query conditions suitable for use with
-        *  DatabaseBase::select
+        *  IDatabase::select
         */
        public function addConditions( array $conditions ) {
                $this->conditions = array_merge( $this->conditions, $conditions );
@@ -106,7 +106,7 @@ class BatchRowIterator implements RecursiveIterator {
 
        /**
         * @param array $condition Query join conditions suitable for use
-        *  with DatabaseBase::select
+        *  with IDatabase::select
         */
        public function addJoinConditions( array $conditions ) {
                $this->joinConditions = array_merge( $this->joinConditions, $conditions );
@@ -114,7 +114,7 @@ class BatchRowIterator implements RecursiveIterator {
 
        /**
         * @param array $columns List of column names to select from the
-        *  table suitable for use with DatabaseBase::select()
+        *  table suitable for use with IDatabase::select()
         */
        public function setFetchColumns( array $columns ) {
                // If it's not the all column selector merge in the primary keys we need
@@ -169,7 +169,7 @@ class BatchRowIterator implements RecursiveIterator {
         * @return boolean True when the iterator is in a valid state
         */
        public function valid() {
-               return (bool) $this->current;
+               return (bool)$this->current;
        }
 
        /**