Support joins via EchoBatchRowIterator

Change-Id: Ib52e431edc2d05c4d033163bd64e28e127cad5f7
This commit is contained in:
Erik Bernhardson 2014-11-18 12:19:56 -08:00 committed by EBernhardson
parent a5e63c694c
commit 347d68807f

View file

@ -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