MediaWiki  master
RevisionList.php
Go to the documentation of this file.
1 <?php
25 
28  public function getType() {
29  return 'revision';
30  }
31 
33  public function doQuery( $db ) {
34  $queryBuilder = MediaWikiServices::getInstance()->getRevisionStore()->newSelectQueryBuilder( $db )
35  ->joinComment()
36  ->joinPage()
37  ->joinUser()
38  ->where( [ 'rev_page' => $this->page->getId() ] )
39  ->orderBy( 'rev_id', SelectQueryBuilder::SORT_DESC );
40  if ( $this->ids !== null ) {
41  $queryBuilder->andWhere( [ 'rev_id' => array_map( 'intval', $this->ids ) ] );
42  }
43  return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
44  }
45 
47  public function newItem( $row ) {
48  return new RevisionItem( $this, $row );
49  }
50 }
Service locator for MediaWiki core services.
Item class for a live revision table row.
List for revision table items for a single page.
newItem( $row)
Create an item object from a DB result row.RevisionItemBase
doQuery( $db)
Do the DB query to iterate through the objects.DB object to use for the query IResultWrapper
getType()
Get the internal type name of this list.Equal to the table name. Override this function....
Build SELECT queries with a fluent interface.