MediaWiki  REL1_24
Revision Class Reference
Inheritance diagram for Revision:
Collaboration diagram for Revision:

List of all members.

Public Member Functions

 __construct ($row)
 Constructor.
 getComment ($audience=self::FOR_PUBLIC, User $user=null)
 Fetch revision comment if it's available to the specified audience.
 getContent ($audience=self::FOR_PUBLIC, User $user=null)
 Fetch revision content if it's available to the specified audience.
 getContentFormat ()
 Returns the content format for this revision.
 getContentHandler ()
 Returns the content handler appropriate for this revision's content model.
 getContentModel ()
 Returns the content model for this revision.
 getId ()
 Get revision ID.
 getNext ()
 Get next revision for this title.
 getPage ()
 Get the page ID.
 getParentId ()
 Get parent revision ID (the original previous page revision)
 getPrevious ()
 Get previous revision for this title.
 getRawComment ()
 Fetch revision comment without regard for the current user's permissions.
 getRawText ()
 Fetch revision text without regard for view restrictions.
 getRawUser ()
 Fetch revision's user id without regard for the current user's permissions.
 getRawUserText ()
 Fetch revision's username without regard for view restrictions.
 getRecentChange ()
 Get the RC object belonging to the current revision, if there's one.
 getSerializedData ()
 Fetch original serialized data without regard for view restrictions.
 getSha1 ()
 Returns the base36 sha1 of the text in this revision, or null if unknown.
 getSize ()
 Returns the length of the text in this revision, or null if unknown.
 getText ($audience=self::FOR_PUBLIC, User $user=null)
 Fetch revision text if it's available to the specified audience.
 getTextId ()
 Get text row ID.
 getTimestamp ()
 getTitle ()
 Returns the title of the page associated with this entry or null.
 getUser ($audience=self::FOR_PUBLIC, User $user=null)
 Fetch revision's user id if it's available to the specified audience.
 getUserText ($audience=self::FOR_PUBLIC, User $user=null)
 Fetch revision's username if it's available to the specified audience.
 getVisibility ()
 Get the deletion bitfield of the revision.
 insertOn ($dbw)
 Insert a new revision into the database, returning the new revision ID number on success and dies horribly on failure.
 isCurrent ()
 isDeleted ($field)
 isMinor ()
 isUnpatrolled ()
 setId ($id)
 Set the revision ID.
 setTitle ($title)
 Set the title of the revision.
 userCan ($field, User $user=null)
 Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted.

Static Public Member Functions

static base36Sha1 ($text)
 Get the base 36 SHA-1 value for a string of text.
static compressRevisionText (&$text)
 If $wgCompressRevisions is enabled, we will compress data.
static countByPageId ($db, $id)
 Get count of revisions per page...not very efficient.
static countByTitle ($db, $title)
 Get count of revisions per page...not very efficient.
static decompressRevisionText ($text, $flags)
 Re-converts revision text according to it's flags.
static fetchRevision ($title)
 Return a wrapper for a series of database rows to fetch all of a given page's revisions in turn.
static getParentLengths ($db, array $revIds)
 Do a batched query to get the parent revision lengths.
static getRevisionText ($row, $prefix= 'old_', $wiki=false)
 Get revision text associated with an old or archive row $row is usually an object from wfFetchRow(), both the flags and the text field must be included.
static getTimestampFromId ($title, $id)
 Get rev_timestamp from rev_id, without loading the rest of the row.
static loadFromId ($db, $id)
 Load a page revision from a given revision ID number.
static loadFromPageId ($db, $pageid, $id=0)
 Load either the current, or a specified, revision that's attached to a given page.
static loadFromTimestamp ($db, $title, $timestamp)
 Load the revision for the given title with the given timestamp.
static loadFromTitle ($db, $title, $id=0)
 Load either the current, or a specified, revision that's attached to a given page.
static newFromArchiveRow ($row, $overrides=array())
 Make a fake revision object from an archive table row.
static newFromId ($id, $flags=0)
 Load a page revision from a given revision ID number.
static newFromPageId ($pageId, $revId=0, $flags=0)
 Load either the current, or a specified, revision that's attached to a given page ID.
static newFromRow ($row)
static newFromTitle ($title, $id=0, $flags=0)
 Load either the current, or a specified, revision that's attached to a given title.
static newNullRevision ($dbw, $pageId, $summary, $minor, $user=null)
 Create a new null-revision for insertion into a page's history.
static pageJoinCond ()
 Return the value of a select() page conds array for the page table.
static selectArchiveFields ()
 Return the list of revision fields that should be selected to create a new revision from an archive row.
static selectFields ()
 Return the list of revision fields that should be selected to create a new revision.
static selectPageFields ()
 Return the list of page fields that should be selected from page table.
static selectTextFields ()
 Return the list of text fields that should be selected to read the revision text.
static selectUserFields ()
 Return the list of user fields that should be selected from user table.
static userCanBitfield ($bitfield, $field, User $user=null, Title $title=null)
 Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted.
static userJoinCond ()
 Return the value of a select() JOIN conds array for the user table.
static userWasLastToEdit ($db, $pageId, $userId, $since)
 Check if no edits were made by other users since the time a user started editing the page.

Public Attributes

const DELETED_COMMENT = 2
const DELETED_RESTRICTED = 8
const DELETED_TEXT = 1
const DELETED_USER = 4
const FOR_PUBLIC = 1
const FOR_THIS_USER = 2
const RAW = 3
const SUPPRESSED_USER = 12

Protected Member Functions

 checkContentModel ()
 getContentInternal ()
 Gets the content object for the revision (or null on failure).
 loadText ()
 Lazy-load the revision's text.

Protected Attributes

 $mComment
Content null bool $mContent
 $mContentFormat
null ContentHandler $mContentHandler
 $mContentModel
 $mCurrent
 $mDeleted
 $mId
 $mMinorEdit
 $mOrigUserText
int null $mPage
 $mParentId
int $mQueryFlags = 0
 $mSha1
 $mSize
 $mText
 $mTextId
stdClass null $mTextRow
 $mTimestamp
null Title $mTitle
 $mUser
 $mUserText

Private Member Functions

 getPreviousRevisionId ($db)
 Get previous revision Id for this page_id This is used to populate rev_parent_id on save.

Static Private Member Functions

static fetchFromConds ($db, $conditions, $flags=0)
 Given a set of conditions, return a ResultWrapper which will return matching database rows with the fields necessary to build Revision objects.
static loadFromConds ($db, $conditions, $flags=0)
 Given a set of conditions, fetch a revision from the given database connection.
static newFromConds ($conditions, $flags=0)
 Given a set of conditions, fetch a revision.

Detailed Description

Todo:
document

Definition at line 26 of file Revision.php.


Constructor & Destructor Documentation

Constructor.

Parameters:
object | array$rowEither a database row or an array
Exceptions:
MWException
Access:
private

Definition at line 531 of file Revision.php.


Member Function Documentation

static Revision::base36Sha1 ( text) [static]

Get the base 36 SHA-1 value for a string of text.

Parameters:
string$text
Returns:
string

Definition at line 1483 of file Revision.php.

References wfBaseConvert().

Referenced by RevisionTest\dataGetSha1(), PopulateRevisionSha1\upgradeLegacyArchiveRow(), and PopulateRevisionSha1\upgradeRow().

Revision::checkContentModel ( ) [protected]

Definition at line 1429 of file Revision.php.

static Revision::compressRevisionText ( &$  text) [static]

If $wgCompressRevisions is enabled, we will compress data.

The input string is modified in place. Return value is the flags field: contains 'gzip' if the data is compressed, and 'utf-8' if we're saving in UTF-8 mode.

Parameters:
mixed$textReference to a text
Returns:
string

Definition at line 1265 of file Revision.php.

Referenced by CheckStorage\importRevision(), RevisionTest\testCompressRevisionTextUtf8(), and RevisionTest\testCompressRevisionTextUtf8Gzip().

static Revision::countByPageId ( db,
id 
) [static]

Get count of revisions per page...not very efficient.

Parameters:
DatabaseBase$db
int$idPage id
Returns:
int

Definition at line 1720 of file Revision.php.

static Revision::countByTitle ( db,
title 
) [static]

Get count of revisions per page...not very efficient.

Parameters:
DatabaseBase$db
Title$title
Returns:
int

Definition at line 1736 of file Revision.php.

static Revision::decompressRevisionText ( text,
flags 
) [static]

Re-converts revision text according to it's flags.

Parameters:
mixed$textReference to a text
array$flagsCompression flags
Returns:
string|bool Decompressed text, or false on failure

Definition at line 1291 of file Revision.php.

static Revision::fetchFromConds ( db,
conditions,
flags = 0 
) [static, private]

Given a set of conditions, return a ResultWrapper which will return matching database rows with the fields necessary to build Revision objects.

Parameters:
DatabaseBase$db
array$conditions
int$flags(optional)
Returns:
ResultWrapper

Definition at line 364 of file Revision.php.

static Revision::fetchRevision ( title) [static]

Return a wrapper for a series of database rows to fetch all of a given page's revisions in turn.

Each row can be fed to the constructor to get objects.

Parameters:
Title$title
Returns:
ResultWrapper

Definition at line 343 of file Revision.php.

Revision::getComment ( audience = self::FOR_PUBLIC,
User user = null 
)

Fetch revision comment if it's available to the specified audience.

If the specified audience does not have access to the comment, an empty string will be returned.

Parameters:
int$audienceOne of: Revision::FOR_PUBLIC to be displayed to all users Revision::FOR_THIS_USER to be displayed to the given user Revision::RAW get the text regardless of permissions
User$userUser object to check for, only if FOR_THIS_USER is passed to the $audience parameter
Returns:
string

Definition at line 888 of file Revision.php.

Referenced by Linker\revComment().

Revision::getContent ( audience = self::FOR_PUBLIC,
User user = null 
)

Fetch revision content if it's available to the specified audience.

If the specified audience does not have the ability to view this revision, null will be returned.

Parameters:
int$audienceOne of: Revision::FOR_PUBLIC to be displayed to all users Revision::FOR_THIS_USER to be displayed to $wgUser Revision::RAW get the text regardless of permissions
User$userUser object to check for, only if FOR_THIS_USER is passed to the $audience parameter
Since:
1.21
Returns:
Content|null

Definition at line 1003 of file Revision.php.

Returns the content format for this revision.

If no content format was stored in the database, the default format for this revision's content model is returned.

Returns:
string The content format id associated with this revision, see the CONTENT_FORMAT_XXX constants.

Definition at line 1101 of file Revision.php.

Referenced by RevisionStorageTest\assertRevEquals().

Returns the content handler appropriate for this revision's content model.

Exceptions:
MWException
Returns:
ContentHandler

Definition at line 1118 of file Revision.php.

Gets the content object for the revision (or null on failure).

Note that for mutable Content objects, each call to this method will return a fresh clone.

Since:
1.21
Returns:
Content|null The Revision's content, or null on failure.

Definition at line 1049 of file Revision.php.

Returns the content model for this revision.

If no content model was stored in the database, $this->getTitle()->getContentModel() is used to determine the content model to use. If no title is know, CONTENT_MODEL_WIKITEXT is used as a last resort.

Returns:
string The content model id associated with this revision, see the CONTENT_MODEL_XXX constants.

Definition at line 1081 of file Revision.php.

Referenced by RevisionStorageTest\assertRevEquals().

Get revision ID.

Returns:
int|null

Definition at line 703 of file Revision.php.

Referenced by RevisionStorageTest\assertRevEquals(), getNext(), getPrevious(), and Linker\getRevDeleteLink().

Get next revision for this title.

Returns:
Revision|null

Definition at line 1168 of file Revision.php.

References getId(), getTitle(), and newFromTitle().

Get the page ID.

Returns:
int|null

Definition at line 799 of file Revision.php.

Referenced by RevisionStorageTest\assertRevEquals().

Get parent revision ID (the original previous page revision)

Returns:
int|null

Definition at line 731 of file Revision.php.

static Revision::getParentLengths ( db,
array revIds 
) [static]

Do a batched query to get the parent revision lengths.

Parameters:
DatabaseBase$db
array$revIds
Returns:
array

Definition at line 507 of file Revision.php.

Referenced by ApiQueryContributions\execute().

Get previous revision for this title.

Returns:
Revision|null

Definition at line 1153 of file Revision.php.

References getId(), getTitle(), and newFromTitle().

Revision::getPreviousRevisionId ( db) [private]

Get previous revision Id for this page_id This is used to populate rev_parent_id on save.

Parameters:
DatabaseBase$db
Returns:
int

Definition at line 1185 of file Revision.php.

Fetch revision comment without regard for the current user's permissions.

Returns:
string

Definition at line 903 of file Revision.php.

Referenced by Linker\revComment().

Fetch revision text without regard for view restrictions.

Returns:
string
Deprecated:
since 1.21. Instead, use Revision::getContent( Revision::RAW ) or Revision::getSerializedData() as appropriate.

Definition at line 1021 of file Revision.php.

Fetch revision's user id without regard for the current user's permissions.

Returns:
string

Definition at line 831 of file Revision.php.

Fetch revision's username without regard for view restrictions.

Returns:
string

Definition at line 863 of file Revision.php.

References User\whoIs().

Get the RC object belonging to the current revision, if there's one.

Since:
1.22
Returns:
RecentChange|null

Definition at line 936 of file Revision.php.

static Revision::getRevisionText ( row,
prefix = 'old_',
wiki = false 
) [static]

Get revision text associated with an old or archive row $row is usually an object from wfFetchRow(), both the flags and the text field must be included.

Parameters:
stdClass$rowThe text data
string$prefixTable prefix (default 'old_')
string | bool$wikiThe name of the wiki to load the revision text from (same as the the wiki $row was loaded from) or false to indicate the local wiki (this is the default). Otherwise, it must be a symbolic wiki database identifier as understood by the LoadBalancer class.
Returns:
string Text the text requested or false on failure

Definition at line 1216 of file Revision.php.

Referenced by CompressOld\compressWithConcat(), FetchText\doGetText(), RecompressTracked\doOrphanList(), RecompressTracked\doPage(), ApiQueryDeletedrevs\execute(), RevisionTest\testCompressRevisionTextUtf8(), RevisionTest\testCompressRevisionTextUtf8Gzip(), RevisionTest\testGetRevisionText(), RevisionTest\testGetRevisionTextGzip(), RevisionTest\testGetRevisionTextUtf8Legacy(), RevisionTest\testGetRevisionTextUtf8LegacyGzip(), RevisionTest\testGetRevisionTextUtf8Native(), and RevisionTest\testGetRevisionTextUtf8NativeGzip().

Fetch original serialized data without regard for view restrictions.

Since:
1.21
Returns:
string

Definition at line 1032 of file Revision.php.

Returns the base36 sha1 of the text in this revision, or null if unknown.

Returns:
string|null

Definition at line 749 of file Revision.php.

Referenced by RevisionStorageTest\assertRevEquals().

Returns the length of the text in this revision, or null if unknown.

Returns:
int|null

Definition at line 740 of file Revision.php.

Revision::getText ( audience = self::FOR_PUBLIC,
User user = null 
)

Fetch revision text if it's available to the specified audience.

If the specified audience does not have the ability to view this revision, an empty string will be returned.

Parameters:
int$audienceOne of: Revision::FOR_PUBLIC to be displayed to all users Revision::FOR_THIS_USER to be displayed to the given user Revision::RAW get the text regardless of permissions
User$userUser object to check for, only if FOR_THIS_USER is passed to the $audience parameter
Deprecated:
since 1.21, use getContent() instead
Todo:
Replace usage in core
Returns:
string

Definition at line 982 of file Revision.php.

Get text row ID.

Returns:
int|null

Definition at line 722 of file Revision.php.

static Revision::getTimestampFromId ( title,
id 
) [static]

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

Parameters:
Title$title
int$id
Returns:
string

Definition at line 1696 of file Revision.php.

Referenced by ApiSetNotificationTimestamp\execute(), and Skin\lastModified().

Returns the title of the page associated with this entry or null.

Will do a query, when title is not set and id is given.

Returns:
Title|null

Definition at line 760 of file Revision.php.

Referenced by getNext(), getPrevious(), and Linker\revComment().

Revision::getUser ( audience = self::FOR_PUBLIC,
User user = null 
)

Fetch revision's user id if it's available to the specified audience.

If the specified audience does not have access to it, zero will be returned.

Parameters:
int$audienceOne of: Revision::FOR_PUBLIC to be displayed to all users Revision::FOR_THIS_USER to be displayed to the given user Revision::RAW get the ID regardless of permissions
User$userUser object to check for, only if FOR_THIS_USER is passed to the $audience parameter
Returns:
int

Definition at line 816 of file Revision.php.

Referenced by RevisionStorageTest\assertRevEquals().

Revision::getUserText ( audience = self::FOR_PUBLIC,
User user = null 
)

Fetch revision's username if it's available to the specified audience.

If the specified audience does not have access to the username, an empty string will be returned.

Parameters:
int$audienceOne of: Revision::FOR_PUBLIC to be displayed to all users Revision::FOR_THIS_USER to be displayed to the given user Revision::RAW get the text regardless of permissions
User$userUser object to check for, only if FOR_THIS_USER is passed to the $audience parameter
Returns:
string

Definition at line 848 of file Revision.php.

Get the deletion bitfield of the revision.

Returns:
int

Definition at line 962 of file Revision.php.

Referenced by Linker\getRevDeleteLink().

Revision::insertOn ( dbw)

Insert a new revision into the database, returning the new revision ID number on success and dies horribly on failure.

Parameters:
DatabaseBase$dbw(master connection)
Exceptions:
MWException
Returns:
int

Definition at line 1332 of file Revision.php.

Returns:
bool

Definition at line 1144 of file Revision.php.

Revision::isDeleted ( field)
Parameters:
int$fieldOne of DELETED_* bitfield constants
Returns:
bool

Definition at line 953 of file Revision.php.

Referenced by Linker\getRevDeleteLink(), and Linker\revComment().

Returns:
bool

Definition at line 910 of file Revision.php.

Returns:
int Rcid of the unpatrolled row, zero if there isn't one

Definition at line 917 of file Revision.php.

static Revision::loadFromConds ( db,
conditions,
flags = 0 
) [static, private]

Given a set of conditions, fetch a revision from the given database connection.

Parameters:
DatabaseBase$db
array$conditions
int$flags(optional)
Returns:
Revision|null

Definition at line 322 of file Revision.php.

static Revision::loadFromId ( db,
id 
) [static]

Load a page revision from a given revision ID number.

Returns null if no such revision can be found.

Parameters:
DatabaseBase$db
int$id
Returns:
Revision|null

Definition at line 222 of file Revision.php.

static Revision::loadFromPageId ( db,
pageid,
id = 0 
) [static]

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

If not attached to that page, will return null.

Parameters:
DatabaseBase$db
int$pageid
int$id
Returns:
Revision|null

Definition at line 236 of file Revision.php.

static Revision::loadFromTimestamp ( db,
title,
timestamp 
) [static]

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.

Parameters:
DatabaseBase$db
Title$title
string$timestamp
Returns:
Revision|null

Definition at line 281 of file Revision.php.

Referenced by AttachLatest\execute(), and EditPage\setHeaders().

static Revision::loadFromTitle ( db,
title,
id = 0 
) [static]

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

If not attached to that page, will return null.

Parameters:
DatabaseBase$db
Title$title
int$id
Returns:
Revision|null

Definition at line 256 of file Revision.php.

Revision::loadText ( ) [protected]

Lazy-load the revision's text.

Currently hardcoded to the 'text' table storage engine.

Returns:
string|bool The revision's text, or false on failure

Definition at line 1493 of file Revision.php.

static Revision::newFromArchiveRow ( row,
overrides = array() 
) [static]

Make a fake revision object from an archive table row.

This is queried for permissions or even inserted (as in Special:Undelete)

Todo:
FIXME: Should be a subclass for RevisionDelete. [TS]
Parameters:
object$row
array$overrides
Exceptions:
MWException
Returns:
Revision

Definition at line 163 of file Revision.php.

Referenced by RevDelArchiveItem\__construct(), RevDelArchivedRevisionItem\__construct(), PopulateRevisionSha1\upgradeLegacyArchiveRow(), PopulateRevisionLength\upgradeRow(), and PopulateRevisionSha1\upgradeRow().

static Revision::newFromConds ( conditions,
flags = 0 
) [static, private]

Given a set of conditions, fetch a revision.

Parameters:
array$conditions
int$flags(optional)
Returns:
Revision|null

Definition at line 298 of file Revision.php.

static Revision::newFromId ( id,
flags = 0 
) [static]

Load a page revision from a given revision ID number.

Returns null if no such revision can be found.

$flags include: Revision::READ_LATEST : Select the data from the master Revision::READ_LOCKING : Select & lock the data from the master

Parameters:
int$id
int$flags(optional)
Returns:
Revision|null

Definition at line 92 of file Revision.php.

Referenced by SpecialComparePages\checkExistingRevision(), Orphans\checkSeparation(), ApiComparePages\execute(), ApiPatrol\execute(), CheckBadRedirects\execute(), SpecialNewpages\feedItemDesc(), FeedUtils\formatDiffRow(), SpecialComparePages\showDiff(), RevDelRevisionList\suggestTarget(), and ApiRevisionDeleteTest\testHidingRevisions().

static Revision::newFromPageId ( pageId,
revId = 0,
flags = 0 
) [static]

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.

$flags include: Revision::READ_LATEST : Select the data from the master (since 1.20) Revision::READ_LOCKING : Select & lock the data from the master

Parameters:
int$pageId
int$revId(optional)
int$flagsBitfield (optional)
Returns:
Revision|null

Definition at line 141 of file Revision.php.

static Revision::newFromRow ( row) [static]
Since:
1.19
Parameters:
object$row
Returns:
Revision

Definition at line 210 of file Revision.php.

Referenced by ApiFeedContributions\feedItem().

static Revision::newFromTitle ( title,
id = 0,
flags = 0 
) [static]

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

If not attached to that title, will return null.

$flags include: Revision::READ_LATEST : Select the data from the master Revision::READ_LOCKING : Select & lock the data from the master

Parameters:
Title$title
int$id(optional)
int$flagsBitfield (optional)
Returns:
Revision|null

Definition at line 110 of file Revision.php.

Referenced by CleanupSpam\cleanupArticle(), ApiEditPage\execute(), GetTextMaint\execute(), CoreParserFunctions\getCachedRevisionObject(), ResourceLoaderWikiModule\getContent(), Skin\getNewtalks(), getNext(), getPrevious(), RefreshLinksJob\runForTitle(), and SpecialBookSources\showList().

static Revision::newNullRevision ( dbw,
pageId,
summary,
minor,
user = null 
) [static]

Create a new null-revision for insertion into a page's history.

This will not re-save the text, but simply refer to the text from the previous version.

Such revisions can for instance identify page rename operations and other such meta-modifications.

Parameters:
DatabaseBase$dbw
int$pageIdID number of the page to read from
string$summaryRevision's summary
bool$minorWhether the revision should be considered as minor
User | null$userUser object to use or null for $wgUser
Returns:
Revision|null Revision or null on error

Definition at line 1572 of file Revision.php.

Referenced by ImportReporter\reportPage().

static Revision::pageJoinCond ( ) [static]

Return the value of a select() page conds array for the page table.

This will assure that the revision(s) are not orphaned from live pages.

Since:
1.19
Returns:
array

Definition at line 400 of file Revision.php.

static Revision::selectArchiveFields ( ) [static]

Return the list of revision fields that should be selected to create a new revision from an archive row.

Returns:
array

Definition at line 440 of file Revision.php.

References array(), and global.

Referenced by PopulateRevisionLength\doDBUpdates(), and RevDelArchiveList\doQuery().

static Revision::selectFields ( ) [static]

Return the list of revision fields that should be selected to create a new revision.

Returns:
array

Definition at line 409 of file Revision.php.

References array(), and global.

Referenced by PopulateRevisionLength\doDBUpdates(), ApiQueryRevisions\execute(), and RevisionTestContentHandlerUseDB\testSelectFields().

static Revision::selectPageFields ( ) [static]

Return the list of page fields that should be selected from page table.

Returns:
array

Definition at line 482 of file Revision.php.

Referenced by ApiQueryRevisions\execute().

static Revision::selectTextFields ( ) [static]

Return the list of text fields that should be selected to read the revision text.

Returns:
array

Definition at line 471 of file Revision.php.

References array().

Referenced by ApiQueryRevisions\execute().

static Revision::selectUserFields ( ) [static]

Return the list of user fields that should be selected from user table.

Returns:
array

Definition at line 497 of file Revision.php.

Referenced by ApiQueryRevisions\execute().

Revision::setId ( id)

Set the revision ID.

Since:
1.19
Parameters:
int$id

Definition at line 713 of file Revision.php.

Revision::setTitle ( title)

Set the title of the revision.

Parameters:
Title$title

Definition at line 790 of file Revision.php.

References $title.

Revision::userCan ( field,
User user = null 
)

Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted.

Parameters:
int$fieldOne of self::DELETED_TEXT, self::DELETED_COMMENT, self::DELETED_USER
User | null$userUser object to check, or null to use $wgUser
Returns:
bool

Definition at line 1637 of file Revision.php.

Referenced by Linker\getRevDeleteLink(), and Linker\revComment().

static Revision::userCanBitfield ( bitfield,
field,
User user = null,
Title title = null 
) [static]

Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted.

This is used by various classes to avoid duplication.

Parameters:
int$bitfieldCurrent field
int$fieldOne of self::DELETED_TEXT = File::DELETED_FILE, self::DELETED_COMMENT = File::DELETED_COMMENT, self::DELETED_USER = File::DELETED_USER
User | null$userUser object to check, or null to use $wgUser
Title | null$titleA Title object to check for per-page restrictions on, instead of just plain userrights
Returns:
bool

Definition at line 1655 of file Revision.php.

Referenced by ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryWatchlist\extractRowInfo(), ApiQueryContributions\extractRowInfo(), and ApiQueryRecentChanges\extractRowInfo().

static Revision::userJoinCond ( ) [static]

Return the value of a select() JOIN conds array for the user table.

This will get user table rows for logged-in users.

Since:
1.19
Returns:
array

Definition at line 390 of file Revision.php.

Referenced by ApiQueryRevisions\execute().

static Revision::userWasLastToEdit ( db,
pageId,
userId,
since 
) [static]

Check if no edits were made by other users since the time a user started editing the page.

Limit to 50 revisions for the sake of performance.

Since:
1.20
Deprecated:
since 1.24
Parameters:
DatabaseBase | int$dbThe Database to perform the check on. May be given as a Database object or a database identifier usable with wfGetDB.
int$pageIdThe ID of the page in question
int$userIdThe ID of the user in question
string$sinceLook at edits since this time
Returns:
bool True if the given user was the only one to edit since the given timestamp

Definition at line 1760 of file Revision.php.


Member Data Documentation

Revision::$mComment [protected]

Definition at line 41 of file Revision.php.

Content null bool Revision::$mContent [protected]

Definition at line 58 of file Revision.php.

Revision::$mContentFormat [protected]

Definition at line 54 of file Revision.php.

null ContentHandler Revision::$mContentHandler [protected]

Definition at line 62 of file Revision.php.

Revision::$mContentModel [protected]

Definition at line 53 of file Revision.php.

Revision::$mCurrent [protected]

Definition at line 52 of file Revision.php.

Revision::$mDeleted [protected]

Definition at line 37 of file Revision.php.

Revision::$mId [protected]

Definition at line 27 of file Revision.php.

Revision::$mMinorEdit [protected]

Definition at line 35 of file Revision.php.

Revision::$mOrigUserText [protected]

Definition at line 33 of file Revision.php.

int null Revision::$mPage [protected]

Definition at line 31 of file Revision.php.

Revision::$mParentId [protected]

Definition at line 40 of file Revision.php.

int Revision::$mQueryFlags = 0 [protected]

Definition at line 66 of file Revision.php.

Revision::$mSha1 [protected]

Definition at line 39 of file Revision.php.

Revision::$mSize [protected]

Definition at line 38 of file Revision.php.

Revision::$mText [protected]

Definition at line 42 of file Revision.php.

Revision::$mTextId [protected]

Definition at line 43 of file Revision.php.

stdClass null Revision::$mTextRow [protected]

Definition at line 47 of file Revision.php.

Revision::$mTimestamp [protected]

Definition at line 36 of file Revision.php.

null Title Revision::$mTitle [protected]

Definition at line 51 of file Revision.php.

Revision::$mUser [protected]

Definition at line 34 of file Revision.php.

Revision::$mUserText [protected]

Definition at line 32 of file Revision.php.

Definition at line 73 of file Revision.php.

Referenced by DeletedContribsPager\getQueryInfo().


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