MediaWiki  master
MediaWiki\Revision\ArchivedRevisionLookup Class Reference
Collaboration diagram for MediaWiki\Revision\ArchivedRevisionLookup:

Public Member Functions

 __construct (ILoadBalancer $loadBalancer, RevisionStore $revisionStore)
 
 getArchivedRevisionRecord (PageIdentity $page, int $revId)
 Return the archived revision with the given ID. More...
 
 getLastRevisionId (PageIdentity $page)
 Returns the ID of the latest deleted revision. More...
 
 getPreviousRevisionRecord (PageIdentity $page, string $timestamp)
 Return the most-previous revision, either live or deleted, against the deleted revision given by timestamp. More...
 
 getRevisionRecordByTimestamp (PageIdentity $page, $timestamp)
 Return a RevisionRecord object containing data for the deleted revision. More...
 
 hasArchivedRevisions (PageIdentity $page)
 Quick check if any archived revisions are present for the page. More...
 
 listRevisions (PageIdentity $page)
 List the revisions of the given page. More...
 

Private Member Functions

 getRevisionByConditions (PageIdentity $page, array $conditions, array $options=[])
 

Private Attributes

ILoadBalancer $loadBalancer
 
RevisionStore $revisionStore
 

Detailed Description

Since
1.38

Definition at line 31 of file ArchivedRevisionLookup.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Revision\ArchivedRevisionLookup::__construct ( ILoadBalancer  $loadBalancer,
RevisionStore  $revisionStore 
)
Parameters
ILoadBalancer$loadBalancer
RevisionStore$revisionStore

Definition at line 43 of file ArchivedRevisionLookup.php.

References MediaWiki\Revision\ArchivedRevisionLookup\$loadBalancer, and MediaWiki\Revision\ArchivedRevisionLookup\$revisionStore.

Member Function Documentation

◆ getArchivedRevisionRecord()

MediaWiki\Revision\ArchivedRevisionLookup::getArchivedRevisionRecord ( PageIdentity  $page,
int  $revId 
)

Return the archived revision with the given ID.

Parameters
PageIdentity$page
int$revId
Returns
RevisionRecord|null

Definition at line 115 of file ArchivedRevisionLookup.php.

◆ getLastRevisionId()

MediaWiki\Revision\ArchivedRevisionLookup::getLastRevisionId ( PageIdentity  $page)

Returns the ID of the latest deleted revision.

Parameters
PageIdentity$page
Returns
int|false The revision's ID, or false if there is no deleted revision.

Definition at line 218 of file ArchivedRevisionLookup.php.

References $dbr, DB_REPLICA, Page\PageReference\getDBkey(), and Page\PageReference\getNamespace().

◆ getPreviousRevisionRecord()

MediaWiki\Revision\ArchivedRevisionLookup::getPreviousRevisionRecord ( PageIdentity  $page,
string  $timestamp 
)

Return the most-previous revision, either live or deleted, against the deleted revision given by timestamp.

May produce unexpected results in case of history merges or other unusual time issues.

Parameters
PageIdentity$page
string$timestamp
Returns
RevisionRecord|null Null when there is no previous revision

Definition at line 166 of file ArchivedRevisionLookup.php.

◆ getRevisionByConditions()

MediaWiki\Revision\ArchivedRevisionLookup::getRevisionByConditions ( PageIdentity  $page,
array  $conditions,
array  $options = [] 
)
private
Parameters
PageIdentity$page
array$conditions
array$options
Returns
RevisionRecord|null

Definition at line 126 of file ArchivedRevisionLookup.php.

◆ getRevisionRecordByTimestamp()

MediaWiki\Revision\ArchivedRevisionLookup::getRevisionRecordByTimestamp ( PageIdentity  $page,
  $timestamp 
)

Return a RevisionRecord object containing data for the deleted revision.

Access: internal
only for use in SpecialUndelete
Parameters
PageIdentity$page
string$timestamp
Returns
RevisionRecord|null

Definition at line 100 of file ArchivedRevisionLookup.php.

◆ hasArchivedRevisions()

MediaWiki\Revision\ArchivedRevisionLookup::hasArchivedRevisions ( PageIdentity  $page)

Quick check if any archived revisions are present for the page.

This says nothing about whether the page currently exists in the page table or not.

Parameters
PageIdentity$page
Returns
bool

Definition at line 240 of file ArchivedRevisionLookup.php.

◆ listRevisions()

MediaWiki\Revision\ArchivedRevisionLookup::listRevisions ( PageIdentity  $page)

List the revisions of the given page.

Returns result wrapper with various archive table fields.

Parameters
PageIdentity$page
Returns
IResultWrapper|bool

Definition at line 58 of file ArchivedRevisionLookup.php.

References $dbr, DB_REPLICA, Page\PageReference\getDBkey(), Page\PageReference\getNamespace(), and ChangeTags\modifyDisplayQuery().

Member Data Documentation

◆ $loadBalancer

ILoadBalancer MediaWiki\Revision\ArchivedRevisionLookup::$loadBalancer
private

◆ $revisionStore

RevisionStore MediaWiki\Revision\ArchivedRevisionLookup::$revisionStore
private

The documentation for this class was generated from the following file: