diff --git a/includes/BatchRowUpdate.php b/includes/BatchRowUpdate.php index 12a283242..8838fca8c 100644 --- a/includes/BatchRowUpdate.php +++ b/includes/BatchRowUpdate.php @@ -240,6 +240,11 @@ class EchoBatchRowIterator implements RecursiveIterator { */ protected $conditions = array(); + /** + * @var array $joinConditions + */ + protected $joinConditions = array(); + /** * @var array $fetchColumns List of column names to select from the table suitable for use with DatabaseBase::select() */ @@ -287,6 +292,10 @@ class EchoBatchRowIterator implements RecursiveIterator { $this->conditions = array_merge( $this->conditions, $conditions ); } + public function addJoinConditions( array $conditions ) { + $this->joinConditions = array_merge( $this->joinConditions, $conditions ); + } + /** * @param array $columns List of column names to select from the table suitable for use with DatabaseBase::select() */ @@ -369,7 +378,8 @@ class EchoBatchRowIterator implements RecursiveIterator { array( 'LIMIT' => $this->batchSize, 'ORDER BY' => $this->orderBy, - ) + ), + $this->joinConditions ); // The iterator is converted to an array because in addition to returning it