MediaWiki master
RevisionList.php
Go to the documentation of this file.
1<?php
10
13
16 public function getType() {
17 return 'revision';
18 }
19
21 public function doQuery( $db ) {
22 $queryBuilder = MediaWikiServices::getInstance()->getRevisionStore()->newSelectQueryBuilder( $db )
23 ->joinComment()
24 ->joinPage()
25 ->joinUser()
26 ->where( [ 'rev_page' => $this->page->getId() ] )
27 ->orderBy( 'rev_id', SelectQueryBuilder::SORT_DESC );
28 if ( $this->ids !== null ) {
29 $queryBuilder->andWhere( [ 'rev_id' => array_map( 'intval', $this->ids ) ] );
30 }
31 return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
32 }
33
35 public function newItem( $row ) {
36 return new RevisionItem( $this, $row );
37 }
38}
40class_alias( RevisionList::class, 'RevisionList' );
Service locator for MediaWiki core services.
static getInstance()
Returns the global default instance of the top level service locator.
Item class for a live revision table row.
List for revision table items for a single page.
doQuery( $db)
Do the DB query to iterate through the objects.IResultWrapper
newItem( $row)
Create an item object from a DB result row.RevisionItemBase
getType()
Get the internal type name of this list.Equal to the table name. Override this function....
Build SELECT queries with a fluent interface.