mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-09-24 10:49:37 +00:00
Support joins via EchoBatchRowIterator
Change-Id: Ib52e431edc2d05c4d033163bd64e28e127cad5f7
This commit is contained in:
parent
a5e63c694c
commit
347d68807f
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue