MediaWiki  master
Revision\RevisionLookup Interface Reference

Service for looking up page revisions. More...

Inheritance diagram for Revision\RevisionLookup:
Collaboration diagram for Revision\RevisionLookup:

Public Member Functions

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

Additional Inherited Members

- Public Attributes inherited from IDBAccessObject
const READ_LOCKING = self::READ_LATEST | 2
 Constants for object loading bitfield flags (higher => higher QoS) More...
 
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
1.32 Renamed from MediaWiki\Storage\RevisionLookup

Definition at line 38 of file RevisionLookup.php.

Member Function Documentation

◆ getKnownCurrentRevision()

Revision\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 Revision\RevisionStore.

◆ getNextRevision()

Revision\RevisionLookup::getNextRevision ( RevisionRecord  $rev,
  $flags = 0 
)

Get next revision for this title.

MCR migration note: this replaces Revision::getNext

Parameters
RevisionRecord$rev
int$flags(optional) $flags include: IDBAccessObject::READ_LATEST: Select the data from the master
Returns
RevisionRecord|null

Implemented in Revision\RevisionStore.

◆ getPreviousRevision()

Revision\RevisionLookup::getPreviousRevision ( RevisionRecord  $rev,
  $flags = 0 
)

Get previous revision for this title.

MCR migration note: this replaces Revision::getPrevious

Parameters
RevisionRecord$rev
int$flags(optional) $flags include: IDBAccessObject::READ_LATEST: Select the data from the master
Returns
RevisionRecord|null

Implemented in Revision\RevisionStore.

◆ getRevisionById()

Revision\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 Revision\RevisionStore.

◆ getRevisionByPageId()

Revision\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 Revision\RevisionStore.

◆ getRevisionByTitle()

Revision\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 Revision\RevisionStore.

◆ getTimestampFromId()

Revision\RevisionLookup::getTimestampFromId (   $id,
  $flags = 0 
)

Get rev_timestamp from rev_id, without loading the rest of the row.

MCR migration note: this replaces Revision::getTimestampFromId

Parameters
int$id
int$flags
Returns
string|bool False if not found
Since
1.34 (present earlier in RevisionStore)

Implemented in Revision\RevisionStore.


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