MediaWiki  master
RevisionLookup.php
Go to the documentation of this file.
1 <?php
23 namespace MediaWiki\Revision;
24 
25 use IDBAccessObject;
28 
38 interface RevisionLookup extends IDBAccessObject {
39 
55  public function getRevisionById( $id, $flags = 0, PageIdentity $page = null );
56 
69  public function getRevisionByTitle( $page, $revId = 0, $flags = 0 );
70 
83  public function getRevisionByPageId( $pageId, $revId = 0, $flags = 0 );
84 
100  public function getRevisionByTimestamp(
101  $page,
102  string $timestamp,
103  int $flags = RevisionLookup::READ_NORMAL
104  ): ?RevisionRecord;
105 
117  public function getPreviousRevision( RevisionRecord $rev, $flags = 0 );
118 
130  public function getNextRevision( RevisionRecord $rev, $flags = 0 );
131 
142  public function getTimestampFromId( $id, $flags = 0 );
143 
157  public function getKnownCurrentRevision( PageIdentity $page, $revId = 0 );
158 
167  public function getFirstRevision(
168  $page,
169  int $flags = IDBAccessObject::READ_NORMAL
170  ): ?RevisionRecord;
171 
172 }
173 
178 class_alias( RevisionLookup::class, 'MediaWiki\Storage\RevisionLookup' );
Page\PageIdentity
Interface for objects (potentially) representing an editable wiki page.
Definition: PageIdentity.php:64
MediaWiki\Revision\RevisionLookup\getRevisionByPageId
getRevisionByPageId( $pageId, $revId=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given page ID.
MediaWiki\Revision\RevisionRecord
Page revision base class.
Definition: RevisionRecord.php:47
MediaWiki\Revision\RevisionLookup\getFirstRevision
getFirstRevision( $page, int $flags=IDBAccessObject::READ_NORMAL)
Get the first revision of the page.
IDBAccessObject
Interface for database access objects.
Definition: IDBAccessObject.php:57
MediaWiki\Revision\RevisionLookup
Service for looking up page revisions.
Definition: RevisionLookup.php:38
MediaWiki\Revision
Definition: ContributionsLookup.php:3
MediaWiki\Revision\RevisionLookup\getRevisionByTimestamp
getRevisionByTimestamp( $page, string $timestamp, int $flags=RevisionLookup::READ_NORMAL)
Load the revision for the given title with the given timestamp.
MediaWiki\Revision\RevisionLookup\getRevisionByTitle
getRevisionByTitle( $page, $revId=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target.
MediaWiki\Revision\RevisionLookup\getNextRevision
getNextRevision(RevisionRecord $rev, $flags=0)
Get next revision for this title.
MediaWiki\Revision\RevisionLookup\getKnownCurrentRevision
getKnownCurrentRevision(PageIdentity $page, $revId=0)
Load a revision based on a known page ID and current revision ID from the DB.
MediaWiki\Revision\RevisionLookup\getPreviousRevision
getPreviousRevision(RevisionRecord $rev, $flags=0)
Get previous revision for this title.
MediaWiki\Revision\RevisionLookup\getTimestampFromId
getTimestampFromId( $id, $flags=0)
Get rev_timestamp from rev_id, without loading the rest of the row.
MediaWiki\Linker\LinkTarget
Definition: LinkTarget.php:26
MediaWiki\Revision\RevisionLookup\getRevisionById
getRevisionById( $id, $flags=0, PageIdentity $page=null)
Load a page revision from a given revision ID number.