MediaWiki REL1_35
|
Service for looking up page revisions. More...
Public Member Functions | |
getFirstRevision (LinkTarget $title, int $flags=IDBAccessObject::READ_NORMAL) | |
Get the first revision of the page. | |
getKnownCurrentRevision (Title $title, $revId=0) | |
Load a revision based on a known page ID and current revision ID from the DB. | |
getNextRevision (RevisionRecord $rev, $flags=0) | |
Get next revision for this title. | |
getPreviousRevision (RevisionRecord $rev, $flags=0) | |
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. | |
getRevisionByTimestamp (LinkTarget $title, string $timestamp, int $flags=RevisionLookup::READ_NORMAL) | |
Load the revision for the given title with the given timestamp. | |
getRevisionByTitle (LinkTarget $linkTarget, $revId=0, $flags=0) | |
Load either the current, or a specified, revision that's attached to a given link target. | |
getTimestampFromId ( $id, $flags=0) | |
Get rev_timestamp from rev_id, without loading the rest of the row. | |
Additional Inherited Members | |
Public Attributes inherited from IDBAccessObject | |
const | READ_LOCKING = self::READ_LATEST | 2 |
Constants for object loading bitfield flags (higher => higher QoS) | |
const | READ_NONE = -1 |
Service for looking up page revisions.
Definition at line 38 of file RevisionLookup.php.
MediaWiki\Revision\RevisionLookup::getFirstRevision | ( | LinkTarget | $title, |
int | $flags = IDBAccessObject::READ_NORMAL |
||
) |
Get the first revision of the page.
LinkTarget | $title | the title of the page fetch the first revision for. |
int | $flags | bit field, see IDBAccessObject::READ_* constants. |
Implemented in MediaWiki\Revision\RevisionStore.
MediaWiki\Revision\RevisionLookup::getKnownCurrentRevision | ( | Title | $title, |
$revId = 0 |
|||
) |
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
Title | $title | the associated page title |
int | $revId | current revision of this page |
Implemented in MediaWiki\Revision\RevisionStore.
MediaWiki\Revision\RevisionLookup::getNextRevision | ( | RevisionRecord | $rev, |
$flags = 0 |
|||
) |
Get next revision for this title.
MCR migration note: this replaces Revision::getNext
RevisionRecord | $rev | |
int | $flags | (optional) $flags include: IDBAccessObject::READ_LATEST: Select the data from the master |
Implemented in MediaWiki\Revision\RevisionStore.
Referenced by MediaWiki\User\WatchlistNotificationManager\clearTitleUserNotifications().
MediaWiki\Revision\RevisionLookup::getPreviousRevision | ( | RevisionRecord | $rev, |
$flags = 0 |
|||
) |
Get previous revision for this title.
MCR migration note: this replaces Revision::getPrevious
RevisionRecord | $rev | |
int | $flags | (optional) $flags include: IDBAccessObject::READ_LATEST: Select the data from the master |
Implemented in MediaWiki\Revision\RevisionStore.
MediaWiki\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:
int | $id | |
int | $flags | bit field, see IDBAccessObject::READ_XXX |
Implemented in MediaWiki\Revision\RevisionStore.
Referenced by MediaWiki\User\WatchlistNotificationManager\clearTitleUserNotifications().
MediaWiki\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
int | $pageId | |
int | $revId | (optional) |
int | $flags | bit field, see IDBAccessObject::READ_XXX |
Implemented in MediaWiki\Revision\RevisionStore.
MediaWiki\Revision\RevisionLookup::getRevisionByTimestamp | ( | LinkTarget | $title, |
string | $timestamp, | ||
int | $flags = RevisionLookup::READ_NORMAL |
||
) |
Load the revision for the given title with the given timestamp.
WARNING: Timestamps may in some circumstances not be unique, so this isn't the best key to use.
MCR migration note: this replaces Revision::loadFromTimestamp
LinkTarget | $title | |
string | $timestamp | |
int | $flags | Bitfield (optional) include: RevisionLookup::READ_LATEST: Select the data from the master RevisionLookup::READ_LOCKING: Select & lock the data from the master Default: RevisionLookup::READ_NORMAL |
Implemented in MediaWiki\Revision\RevisionStore.
MediaWiki\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
LinkTarget | $linkTarget | |
int | $revId | (optional) |
int | $flags | bit field, see IDBAccessObject::READ_XXX |
Implemented in MediaWiki\Revision\RevisionStore.
MediaWiki\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
int | $id | |
int | $flags |
Implemented in MediaWiki\Revision\RevisionStore.