MediaWiki  master
RevisionList.php
Go to the documentation of this file.
1 <?php
24 
27  public function getType() {
28  return 'revision';
29  }
30 
32  public function doQuery( $db ) {
33  $conds = [ 'rev_page' => $this->title->getId() ];
34  if ( $this->ids !== null ) {
35  $conds['rev_id'] = array_map( 'intval', $this->ids );
36  }
37  $revQuery = MediaWikiServices::getInstance()
38  ->getRevisionStore()
39  ->getQueryInfo( [ 'page', 'user' ] );
40  return $db->select(
41  $revQuery['tables'],
42  $revQuery['fields'],
43  $conds,
44  __METHOD__,
45  [ 'ORDER BY' => 'rev_id DESC' ],
46  $revQuery['joins']
47  );
48  }
49 
51  public function newItem( $row ) {
52  return new RevisionItem( $this, $row );
53  }
54 }
RevisionList\getType
getType()
Get the internal type name of this list.Equal to the table name. Override this function....
Definition: RevisionList.php:27
RevisionListBase
List for revision table items for a single page.
Definition: RevisionListBase.php:30
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:200
RevisionList
Definition: RevisionList.php:25
$revQuery
$revQuery
Definition: testCompression.php:56
RevisionList\doQuery
doQuery( $db)
Do the DB query to iterate through the objects.DB object to use for the query IResultWrapper
Definition: RevisionList.php:32
RevisionList\newItem
newItem( $row)
Create an item object from a DB result row.RevisionItemBase
Definition: RevisionList.php:51
RevisionItem
Item class for a live revision table row.
Definition: RevisionItem.php:29