MediaWiki REL1_31
MediaWiki\Storage\RevisionLookup Interface Reference

Service for looking up page revisions. More...

Inheritance diagram for MediaWiki\Storage\RevisionLookup:
Collaboration diagram for MediaWiki\Storage\RevisionLookup:

Public Member Functions

 getKnownCurrentRevision (Title $title, $revId)
 Load a revision based on a known page ID and current revision ID from the DB.
 
 getNextRevision (RevisionRecord $rev, Title $title=null)
 Get next revision for this title.
 
 getPreviousRevision (RevisionRecord $rev, Title $title=null)
 Get previous revision for this title.
 
 getRevisionById ( $id, $flags=0)
 Load a page revision from a given revision ID number.
 
 getRevisionByPageId ( $pageId, $revId=0, $flags=0)
 Load either the current, or a specified, revision that's attached to a given page ID.
 
 getRevisionByTitle (LinkTarget $linkTarget, $revId=0, $flags=0)
 Load either the current, or a specified, revision that's attached to a given link target.
 

Additional Inherited Members

- Public Attributes inherited from IDBAccessObject
const READ_LOCKING = 3
 Constants for object loading bitfield flags (higher => higher QoS)
 
const READ_NONE = -1
 

Detailed Description

Service for looking up page revisions.

Note
This was written to act as a drop-in replacement for the corresponding static methods in Revision.
Since
1.31

Definition at line 37 of file RevisionLookup.php.

Member Function Documentation

◆ getKnownCurrentRevision()

MediaWiki\Storage\RevisionLookup::getKnownCurrentRevision ( Title $title,
$revId )

Load a revision based on a known page ID and current revision ID from the DB.

This method allows for the use of caching, though accessing anything that normally requires permission checks (aside from the text) will trigger a small DB lookup.

MCR migration note: this replaces Revision::newKnownCurrent

Parameters
Title$titlethe associated page title
int$revIdcurrent revision of this page
Returns
RevisionRecord|bool Returns false if missing

Implemented in MediaWiki\Storage\RevisionStore.

◆ getNextRevision()

MediaWiki\Storage\RevisionLookup::getNextRevision ( RevisionRecord $rev,
Title $title = null )

Get next revision for this title.

MCR migration note: this replaces Revision::getNext

Parameters
RevisionRecord$rev
Title$titleif known (optional)
Returns
RevisionRecord|null

Implemented in MediaWiki\Storage\RevisionStore.

◆ getPreviousRevision()

MediaWiki\Storage\RevisionLookup::getPreviousRevision ( RevisionRecord $rev,
Title $title = null )

Get previous revision for this title.

MCR migration note: this replaces Revision::getPrevious

Parameters
RevisionRecord$rev
Title$titleif known (optional)
Returns
RevisionRecord|null

Implemented in MediaWiki\Storage\RevisionStore.

◆ getRevisionById()

MediaWiki\Storage\RevisionLookup::getRevisionById ( $id,
$flags = 0 )

Load a page revision from a given revision ID number.

Returns null if no such revision can be found.

MCR migration note: this replaces Revision::newFromId

$flags include:

Parameters
int$id
int$flagsbit field, see IDBAccessObject::READ_XXX
Returns
RevisionRecord|null

Implemented in MediaWiki\Storage\RevisionStore.

◆ getRevisionByPageId()

MediaWiki\Storage\RevisionLookup::getRevisionByPageId ( $pageId,
$revId = 0,
$flags = 0 )

Load either the current, or a specified, revision that's attached to a given page ID.

Returns null if no such revision can be found.

MCR migration note: this replaces Revision::newFromPageId

Parameters
int$pageId
int$revId(optional)
int$flagsbit field, see IDBAccessObject::READ_XXX
Returns
RevisionRecord|null

Implemented in MediaWiki\Storage\RevisionStore.

◆ getRevisionByTitle()

MediaWiki\Storage\RevisionLookup::getRevisionByTitle ( LinkTarget $linkTarget,
$revId = 0,
$flags = 0 )

Load either the current, or a specified, revision that's attached to a given link target.

If not attached to that link target, will return null.

MCR migration note: this replaces Revision::newFromTitle

Parameters
LinkTarget$linkTarget
int$revId(optional)
int$flagsbit field, see IDBAccessObject::READ_XXX
Returns
RevisionRecord|null

Implemented in MediaWiki\Storage\RevisionStore.


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