| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
namespace MediaWiki\RevisionList; |
| 24 |
|
| 25 |
use MediaWiki\MediaWikiServices; |
| 26 |
use Wikimedia\Rdbms\SelectQueryBuilder; |
| 27 |
|
| 28 |
class RevisionList extends RevisionListBase { |
| 29 |
|
| 30 |
public function getType() { |
| 31 |
return 'revision'; |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
public function doQuery( $db ) { |
| 36 |
$queryBuilder = MediaWikiServices::getInstance()->getRevisionStore()->newSelectQueryBuilder( $db ) |
| 37 |
->joinComment() |
| 38 |
->joinPage() |
| 39 |
->joinUser() |
| 40 |
->where( [ 'rev_page' => $this->page->getId() ] ) |
| 41 |
->orderBy( 'rev_id', SelectQueryBuilder::SORT_DESC ); |
| 42 |
if ( $this->ids !== null ) { |
| 43 |
$queryBuilder->andWhere( [ 'rev_id' => array_map( 'intval', $this->ids ) ] ); |
| 44 |
} |
| 45 |
return $queryBuilder->caller( __METHOD__ )->fetchResultSet(); |
| 46 |
} |
| 47 |
|
| 48 |
|
| 49 |
public function newItem( $row ) { |
| 50 |
return new RevisionItem( $this, $row ); |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
class_alias( RevisionList::class, 'RevisionList' ); |