MediaWiki  1.33.0
RevisionList.php
Go to the documentation of this file.
1 <?php
24 
26  public function getType() {
27  return 'revision';
28  }
29 
34  public function doQuery( $db ) {
35  $conds = [ 'rev_page' => $this->title->getArticleID() ];
36  if ( $this->ids !== null ) {
37  $conds['rev_id'] = array_map( 'intval', $this->ids );
38  }
39  $revQuery = Revision::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 
50  public function newItem( $row ) {
51  return new RevisionItem( $this, $row );
52  }
53 }
RevisionList\getType
getType()
Get the internal type name of this list.
Definition: RevisionList.php:26
RevisionListBase
List for revision table items for a single page.
Definition: RevisionListBase.php:29
RevisionList
Definition: RevisionList.php:25
$revQuery
$revQuery
Definition: testCompression.php:51
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
Revision\getQueryInfo
static getQueryInfo( $options=[])
Return the tables, fields, and join conditions to be selected to create a new revision object.
Definition: Revision.php:511
RevisionList\doQuery
doQuery( $db)
Definition: RevisionList.php:34
use
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
RevisionList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition: RevisionList.php:50
title
title
Definition: parserTests.txt:245
RevisionItem
Item class for a live revision table row.
Definition: RevisionItem.php:26