MediaWiki  master
RevisionList.php
Go to the documentation of this file.
1 <?php
25 
27  public function getType() {
28  return 'revision';
29  }
30 
35  public function doQuery( $db ) {
36  $conds = [ 'rev_page' => $this->title->getArticleID() ];
37  if ( $this->ids !== null ) {
38  $conds['rev_id'] = array_map( 'intval', $this->ids );
39  }
40  $revQuery = MediaWikiServices::getInstance()
41  ->getRevisionStore()
42  ->getQueryInfo( [ 'page', 'user' ] );
43  return $db->select(
44  $revQuery['tables'],
45  $revQuery['fields'],
46  $conds,
47  __METHOD__,
48  [ 'ORDER BY' => 'rev_id DESC' ],
49  $revQuery['joins']
50  );
51  }
52 
53  public function newItem( $row ) {
54  return new RevisionItem( $this, $row );
55  }
56 }
RevisionList\getType
getType()
Get the internal type name of this list.
Definition: RevisionList.php:27
RevisionListBase
List for revision table items for a single page.
Definition: RevisionListBase.php:29
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:154
RevisionList
Definition: RevisionList.php:26
$revQuery
$revQuery
Definition: testCompression.php:56
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
RevisionList\doQuery
doQuery( $db)
Definition: RevisionList.php:35
RevisionList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition: RevisionList.php:53
RevisionItem
Item class for a live revision table row.
Definition: RevisionItem.php:29