MediaWiki master
RevisionList.php
Go to the documentation of this file.
1<?php
24
27
30 public function getType() {
31 return 'revision';
32 }
33
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
49 public function newItem( $row ) {
50 return new RevisionItem( $this, $row );
51 }
52}
54class_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.