MediaWiki  master
MediaWiki\Revision\RevisionRecord Class Reference

Page revision base class. More...

Inheritance diagram for MediaWiki\Revision\RevisionRecord:
Collaboration diagram for MediaWiki\Revision\RevisionRecord:

Public Member Functions

 __construct (PageIdentity $page, RevisionSlots $slots, $wikiId=self::LOCAL)
 
 audienceCan ( $field, $audience, Authority $performer=null)
 Check that the given audience has access to the given field. More...
 
 getComment ( $audience=self::FOR_PUBLIC, Authority $performer=null)
 Fetch revision comment, if it's available to the specified audience. More...
 
 getContent ( $role, $audience=self::FOR_PUBLIC, Authority $performer=null)
 Returns the Content of the given slot of this revision. More...
 
 getId ( $wikiId=self::LOCAL)
 Get revision ID. More...
 
 getInheritedSlots ()
 Returns slots inherited from some previous revision. More...
 
 getOriginalSlots ()
 Returns the slots that originate in this revision. More...
 
 getPage ()
 Returns the page this revision belongs to. More...
 
 getPageAsLinkTarget ()
 Returns the title of the page this revision is associated with as a LinkTarget object. More...
 
 getPageId ( $wikiId=self::LOCAL)
 Get the page ID. More...
 
 getParentId ( $wikiId=self::LOCAL)
 Get parent revision ID (the original previous page revision). More...
 
 getPrimarySlots ()
 Returns primary slots (those that are not derived). More...
 
 getSha1 ()
 Returns the base36 sha1 of this revision. More...
 
 getSize ()
 Returns the nominal size of this revision, in bogo-bytes. More...
 
 getSlot ( $role, $audience=self::FOR_PUBLIC, Authority $performer=null)
 Returns meta-data for the given slot. More...
 
 getSlotRoles ()
 Returns the slot names (roles) of all slots present in this revision. More...
 
 getSlots ()
 Returns the slots defined for this revision. More...
 
 getTimestamp ()
 MCR migration note: this replaced Revision::getTimestamp. More...
 
 getUser ( $audience=self::FOR_PUBLIC, Authority $performer=null)
 Fetch revision's author's user identity, if it's available to the specified audience. More...
 
 getVisibility ()
 Get the deletion bitfield of the revision. More...
 
 getWikiId ()
 Get the ID of the wiki this revision belongs to. More...
 
 hasSameContent (RevisionRecord $rec)
 
 hasSlot ( $role)
 Returns whether the given slot is defined in this revision. More...
 
 isCurrent ()
 Checks whether the revision record is a stored current revision. More...
 
 isDeleted ( $field)
 MCR migration note: this replaced Revision::isDeleted. More...
 
 isMinor ()
 MCR migration note: this replaced Revision::isMinor. More...
 
 isReadyForInsertion ()
 Returns whether this RevisionRecord is ready for insertion, that is, whether it contains all information needed to save it to the database. More...
 
 userCan ( $field, Authority $performer)
 Determine if the give authority is allowed to view a particular field of this revision, if it's marked as deleted. More...
 
- Public Member Functions inherited from MediaWiki\DAO\WikiAwareEntity
 assertWiki ( $wikiId)
 Throws if $wikiId is different from the return value of getWikiId(). More...
 

Static Public Member Functions

static userCanBitfield ( $bitfield, $field, Authority $performer, PageIdentity $page=null)
 Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted. More...
 

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_ALL
 
const SUPPRESSED_USER = self::DELETED_USER | self::DELETED_RESTRICTED
 

Protected Attributes

CommentStoreComment null $mComment
 
int $mDeleted = 0
 using the DELETED_XXX and SUPPRESSED_XXX flags More...
 
int null $mId
 
bool $mMinorEdit = false
 
PageIdentity $mPage
 
int $mPageId
 
int null $mParentId
 
string null $mSha1
 
int null $mSize
 
RevisionSlots $mSlots
 
string null $mTimestamp
 
UserIdentity null $mUser
 
string false $wikiId = false
 Wiki ID; false means the current wiki. More...
 

Detailed Description

Page revision base class.

RevisionRecords are considered value objects, but they may use callbacks for lazy loading. Note that while the base class has no setters, subclasses may offer a mutable interface.

Since
1.31
1.32 Renamed from MediaWiki\Storage\RevisionRecord

Definition at line 47 of file RevisionRecord.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Revision\RevisionRecord::__construct ( PageIdentity  $page,
RevisionSlots  $slots,
  $wikiId = self::LOCAL 
)
Note
Avoid calling this constructor directly. Use the appropriate methods in RevisionStore instead.
Parameters
PageIdentity$pageThe page this RevisionRecord is associated with.
RevisionSlots$slotsThe slots of this revision.
false | string$wikiIdRelevant wiki id or self::LOCAL for the current one.

Definition at line 103 of file RevisionRecord.php.

References MediaWiki\Revision\RevisionRecord\$wikiId, and MediaWiki\DAO\assertWikiIdParam().

Member Function Documentation

◆ audienceCan()

MediaWiki\Revision\RevisionRecord::audienceCan (   $field,
  $audience,
Authority  $performer = null 
)

Check that the given audience has access to the given field.

MCR migration note: this corresponded to Revision::userCan

Parameters
int$fieldOne of self::DELETED_TEXT, self::DELETED_COMMENT, self::DELETED_USER
int$audienceOne of: RevisionRecord::FOR_PUBLIC to be displayed to all users RevisionRecord::FOR_THIS_USER to be displayed to the given user RevisionRecord::RAW get the text regardless of permissions
Authority | null$performeruser on who's behalf to check
Returns
bool

Definition at line 479 of file RevisionRecord.php.

References MediaWiki\Revision\RevisionRecord\isDeleted(), and MediaWiki\Revision\RevisionRecord\userCan().

Referenced by MediaWiki\Revision\RevisionRecord\getComment(), MediaWiki\Revision\RevisionRecord\getContent(), MediaWiki\Revision\RevisionRenderer\getRenderedRevision(), MediaWiki\Revision\RevisionRecord\getSlot(), MediaWiki\Revision\RevisionRecord\getUser(), and MediaWiki\CommentFormatter\CommentFormatter\preprocessRevComment().

◆ getComment()

MediaWiki\Revision\RevisionRecord::getComment (   $audience = self::FOR_PUBLIC,
Authority  $performer = null 
)

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

If the specified audience does not have access to the comment, this will return null. Depending on the concrete subclass, null may also be returned if the comment is not yet specified.

MCR migration note: this replaced Revision::getComment

Parameters
int$audienceOne of: RevisionRecord::FOR_PUBLIC to be displayed to all users RevisionRecord::FOR_THIS_USER to be displayed to the given user RevisionRecord::RAW get the text regardless of permissions
Authority | null$performeruser on who's behalf to check
Returns
CommentStoreComment|null

Reimplemented in MediaWiki\Revision\RevisionStoreRecord, and MediaWiki\Revision\RevisionArchiveRecord.

Definition at line 413 of file RevisionRecord.php.

References MediaWiki\Revision\RevisionRecord\$mComment, and MediaWiki\Revision\RevisionRecord\audienceCan().

Referenced by MediaWiki\Storage\PageUpdater\doUpdate(), ApiQueryRevisionsBase\extractRevisionInfo(), ApiFeedContributions\feedItemDesc(), MediaWiki\Revision\RevisionStore\insertRevisionOn(), MediaWiki\Revision\RevisionStore\insertRevisionRowOn(), MediaWiki\Revision\RevisionRecord\isReadyForInsertion(), MediaWiki\Storage\DerivedPageDataUpdater\prepareContent(), and MediaWiki\CommentFormatter\CommentFormatter\preprocessRevComment().

◆ getContent()

MediaWiki\Revision\RevisionRecord::getContent (   $role,
  $audience = self::FOR_PUBLIC,
Authority  $performer = null 
)

Returns the Content of the given slot of this revision.

Call getSlotNames() to get a list of available slots.

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

MCR migration note: this replaced Revision::getContent

Parameters
string$roleThe role name of the desired slot
int$audience
Authority | null$performeruser on whose behalf to check
Returns
Content|null The content of the given slot, or null if access is forbidden.

Definition at line 156 of file RevisionRecord.php.

References $content, MediaWiki\Revision\RevisionRecord\audienceCan(), and MediaWiki\Revision\RevisionRecord\getSlot().

Referenced by ApiFeedContributions\feedItemDesc(), Article\getRevisionRedirectTarget(), EditPage\getUndoContent(), MediaWiki\Storage\DerivedPageDataUpdater\revisionIsRedirect(), BenchmarkParse\runParser(), DifferenceEngine\setRevisions(), and WikiPage\updateRevisionOn().

◆ getId()

MediaWiki\Revision\RevisionRecord::getId (   $wikiId = self::LOCAL)

Get revision ID.

Depending on the concrete subclass, this may return null if the revision ID is not known (e.g. because the revision does not yet exist in the database).

MCR migration note: this replaced Revision::getId

Parameters
string | false$wikiIdThe wiki ID expected by the caller.
Returns
int|null

Reimplemented in MediaWiki\Revision\RevisionStoreRecord, and MediaWiki\Revision\RevisionArchiveRecord.

Definition at line 279 of file RevisionRecord.php.

References MediaWiki\Revision\RevisionRecord\$mId, MediaWiki\Revision\RevisionRecord\$wikiId, and MediaWiki\DAO\deprecateInvalidCrossWiki().

Referenced by MediaWiki\Rest\Handler\RevisionSourceHandler\constructHtmlUrl(), HistoryPager\curLink(), HistoryPager\diffButtons(), SpecialUndelete\diffHeader(), MediaWiki\Storage\PageUpdater\doUpdate(), ApiQueryRevisionsBase\extractAllSlotInfo(), ApiQueryRevisionsBase\extractDeprecatedContent(), ApiQueryRevisionsBase\extractRevisionInfo(), MediaWiki\Revision\RevisionStore\getBaseRevisionRow(), CategoryMembershipChangeJob\getCategoriesAtRev(), McrUndoAction\getNewRevision(), Article\getOldIDFromRequest(), DifferenceEngine\getParserOutput(), RefreshLinksJob\getParserOutputFromCache(), MediaWiki\Revision\RevisionStore\getPreviousRevisionId(), MediaWiki\Revision\RevisionStore\getRecentChange(), MediaWiki\Revision\RevisionStore\getRelativeRevision(), MediaWiki\Revision\RevisionRenderer\getRenderedRevision(), Linker\getRevDeleteLink(), DifferenceEngine\getRevisionHeader(), EditPage\getUndoContent(), MediaWiki\Revision\RevisionRecord\hasSameContent(), MediaWiki\Revision\RevisionStore\insertRevisionOn(), MediaWiki\Storage\DerivedPageDataUpdater\isReusableFor(), HistoryPager\lastLink(), MediaWiki\Revision\MutableRevisionRecord\newFromParentRevision(), MediaWiki\Revision\MutableRevisionRecord\newUpdatedRevisionRecord(), CategoryMembershipChange\notifyCategorization(), McrUndoAction\onSubmit(), MediaWiki\Storage\DerivedPageDataUpdater\prepareContent(), MediaWiki\Storage\DerivedPageDataUpdater\prepareUpdate(), ChangesList\revDateLink(), BenchmarkParse\runParser(), WikiPage\setLastEdit(), MediaWiki\Storage\EditResultBuilder\setOriginalRevision(), DifferenceEngine\setRevisions(), MediaWiki\Revision\RenderedRevision\updateRevision(), WikiPage\updateRevisionOn(), and MediaWiki\Revision\RevisionStore\updateSlotsInternal().

◆ getInheritedSlots()

MediaWiki\Revision\RevisionRecord::getInheritedSlots ( )

Returns slots inherited from some previous revision.

"Inherited" slots are all slots that do not originate in this revision. Note that these slots may still differ from the one in the parent revision. This is the case for rollbacks: slots of a rollback revision are inherited from the rollback target, and are different from the slots in the parent revision, which was rolled back.

Returns
RevisionSlots

Definition at line 255 of file RevisionRecord.php.

◆ getOriginalSlots()

MediaWiki\Revision\RevisionRecord::getOriginalSlots ( )

Returns the slots that originate in this revision.

Note that this does not include any slots inherited from some earlier revision, even if they are different from the slots in the immediate parent revision. This is the case for rollbacks: slots of a rollback revision are inherited from the rollback target, and are different from the slots in the parent revision, which was rolled back.

To find all slots modified by this revision against its immediate parent revision, use RevisionSlotsUpdate::newFromRevisionSlots().

Returns
RevisionSlots

Definition at line 240 of file RevisionRecord.php.

◆ getPage()

MediaWiki\Revision\RevisionRecord::getPage ( )

◆ getPageAsLinkTarget()

MediaWiki\Revision\RevisionRecord::getPageAsLinkTarget ( )

◆ getPageId()

◆ getParentId()

MediaWiki\Revision\RevisionRecord::getParentId (   $wikiId = self::LOCAL)

Get parent revision ID (the original previous page revision).

If there is no parent revision, this returns 0. If the parent revision is undefined or unknown, this returns null.

Note
As of MW 1.31, the database schema allows the parent ID to be NULL to indicate that it is unknown.

MCR migration note: this replaced Revision::getParentId

Parameters
string | false$wikiIdThe wiki ID expected by the caller.
Returns
int|null

Definition at line 297 of file RevisionRecord.php.

References MediaWiki\Revision\RevisionRecord\$mParentId, MediaWiki\Revision\RevisionRecord\$wikiId, and MediaWiki\DAO\deprecateInvalidCrossWiki().

Referenced by ApiQueryRevisionsBase\extractRevisionInfo(), MediaWiki\Storage\DerivedPageDataUpdater\getParentRevision(), MediaWiki\Revision\RevisionStore\insertRevisionOn(), MediaWiki\Storage\DerivedPageDataUpdater\isReusableFor(), MediaWiki\Revision\MutableRevisionRecord\newUpdatedRevisionRecord(), CategoryMembershipChangeJob\notifyUpdatesForRevision(), MediaWiki\Storage\DerivedPageDataUpdater\prepareContent(), MediaWiki\Storage\DerivedPageDataUpdater\prepareUpdate(), and MediaWiki\Revision\RevisionStore\updateSlotsInternal().

◆ getPrimarySlots()

MediaWiki\Revision\RevisionRecord::getPrimarySlots ( )

Returns primary slots (those that are not derived).

Returns
RevisionSlots
Since
1.36

Definition at line 265 of file RevisionRecord.php.

◆ getSha1()

MediaWiki\Revision\RevisionRecord::getSha1 ( )
abstract

Returns the base36 sha1 of this revision.

This hash is derived from the hashes of all slots associated with the revision. May be calculated on the fly if not known, which may in the worst case may involve loading all content.

MCR migration note: this replaced Revision::getSha1

Exceptions
RevisionAccessExceptionif the hash was unknown and could not be calculated.
Returns
string

Reimplemented in MediaWiki\Revision\RevisionStoreRecord, MediaWiki\Revision\RevisionArchiveRecord, and MediaWiki\Revision\MutableRevisionRecord.

Referenced by ApiQueryRevisionsBase\extractRevisionInfo(), MediaWiki\Revision\RevisionStore\findIdenticalRevision(), MediaWiki\Revision\RevisionStore\getBaseRevisionRow(), MediaWiki\Revision\RevisionRecord\hasSameContent(), and MediaWiki\Revision\RevisionStore\insertRevisionOn().

◆ getSize()

MediaWiki\Revision\RevisionRecord::getSize ( )
abstract

Returns the nominal size of this revision, in bogo-bytes.

May be calculated on the fly if not known, which may in the worst case may involve loading all content.

MCR migration note: this replaced Revision::getSize

Exceptions
RevisionAccessExceptionif the size was unknown and could not be calculated.
Returns
int

Reimplemented in MediaWiki\Revision\RevisionStoreRecord, MediaWiki\Revision\RevisionArchiveRecord, and MediaWiki\Revision\MutableRevisionRecord.

Referenced by ApiQueryRevisionsBase\extractRevisionInfo(), MediaWiki\Revision\RevisionStore\getBaseRevisionRow(), MediaWiki\Revision\RevisionRecord\hasSameContent(), and MediaWiki\Revision\RevisionStore\insertRevisionOn().

◆ getSlot()

MediaWiki\Revision\RevisionRecord::getSlot (   $role,
  $audience = self::FOR_PUBLIC,
Authority  $performer = null 
)

Returns meta-data for the given slot.

Parameters
string$roleThe role name of the desired slot
int$audience
Authority | null$performeruser on who's behalf to check
Exceptions
RevisionAccessExceptionif the slot does not exist or slot data could not be lazy-loaded.
Returns
SlotRecord The slot meta-data. If access to the slot's content is forbidden, calling getContent() on the SlotRecord will throw an exception.

Definition at line 180 of file RevisionRecord.php.

References MediaWiki\Revision\RevisionRecord\audienceCan(), and MediaWiki\Revision\SlotRecord\newWithSuppressedContent().

Referenced by ApiQueryRevisionsBase\extractAllSlotInfo(), MediaWiki\Revision\RevisionRecord\getContent(), McrUndoAction\getNewRevision(), MediaWiki\Storage\DerivedPageDataUpdater\getSecondaryDataUpdates(), EditPage\getUndoContent(), MediaWiki\Revision\RevisionStore\insertRevisionInternal(), MediaWiki\Revision\RevisionStore\insertRevisionOn(), ResourceLoaderWikiModule\invalidateModuleCache(), MediaWiki\Revision\MutableRevisionRecord\newFromParentRevision(), SpecialUndelete\showDiff(), and WikiPage\updateRevisionOn().

◆ getSlotRoles()

MediaWiki\Revision\RevisionRecord::getSlotRoles ( )

◆ getSlots()

MediaWiki\Revision\RevisionRecord::getSlots ( )

Returns the slots defined for this revision.

Note
This provides access to slot content with no audience checks applied. Calling getContent() on the RevisionSlots object returned here, or on any SlotRecord it returns from getSlot(), will not fail due to access restrictions. If audience checks are desired, use getSlot( $role, $audience, $performer ) or getContent( $role, $audience, $performer ) instead.
Returns
RevisionSlots

Reimplemented in MediaWiki\Revision\MutableRevisionRecord.

Definition at line 222 of file RevisionRecord.php.

References MediaWiki\Revision\RevisionRecord\$mSlots.

Referenced by FindBadBlobs\checkRevision(), McrUndoAction\getNewRevision(), WikiPage\hasDifferencesOutsideMainSlot(), MediaWiki\Storage\DerivedPageDataUpdater\isReusableFor(), MediaWiki\Revision\MutableRevisionRecord\newUpdatedRevisionRecord(), MediaWiki\Storage\DerivedPageDataUpdater\prepareContent(), MediaWiki\Storage\DerivedPageDataUpdater\prepareUpdate(), and MediaWiki\Revision\RenderedRevision\updateRevision().

◆ getTimestamp()

◆ getUser()

MediaWiki\Revision\RevisionRecord::getUser (   $audience = self::FOR_PUBLIC,
Authority  $performer = null 
)

Fetch revision's author's user identity, if it's available to the specified audience.

If the specified audience does not have access to it, null will be returned. Depending on the concrete subclass, null may also be returned if the user is not yet specified.

MCR migration note: this replaced Revision::getUser

Parameters
int$audienceOne of: RevisionRecord::FOR_PUBLIC to be displayed to all users RevisionRecord::FOR_THIS_USER to be displayed to the given user RevisionRecord::RAW get the ID regardless of permissions
Authority | null$performeruser on who's behalf to check
Returns
UserIdentity|null

Reimplemented in MediaWiki\Revision\RevisionStoreRecord, MediaWiki\Revision\RevisionStoreCacheRecord, and MediaWiki\Revision\RevisionArchiveRecord.

Definition at line 389 of file RevisionRecord.php.

References MediaWiki\Revision\RevisionRecord\$mUser, and MediaWiki\Revision\RevisionRecord\audienceCan().

Referenced by Linker\buildRollbackLink(), ApiQueryRevisionsBase\extractRevisionInfo(), ApiFeedContributions\feedItemAuthor(), Linker\getRollbackEditCount(), MediaWiki\Revision\RevisionStore\insertRevisionOn(), MediaWiki\Revision\RevisionStore\insertRevisionRowOn(), MediaWiki\Revision\RevisionRecord\isReadyForInsertion(), MediaWiki\Revision\MutableRevisionRecord\newUpdatedRevisionRecord(), MediaWiki\Storage\DerivedPageDataUpdater\prepareContent(), MediaWiki\Storage\DerivedPageDataUpdater\prepareUpdate(), Linker\revUserLink(), Linker\revUserTools(), and McrUndoAction\showPreview().

◆ getVisibility()

MediaWiki\Revision\RevisionRecord::getVisibility ( )

◆ getWikiId()

MediaWiki\Revision\RevisionRecord::getWikiId ( )

Get the ID of the wiki this revision belongs to.

Returns
string|false The wiki's logical name, of false to indicate the local wiki.

Implements MediaWiki\DAO\WikiAwareEntity.

Definition at line 345 of file RevisionRecord.php.

References MediaWiki\Revision\RevisionRecord\$wikiId.

Referenced by MediaWiki\Revision\RevisionRenderer\getRenderedRevision(), MediaWiki\Revision\MutableRevisionRecord\newFromParentRevision(), and MediaWiki\Revision\MutableRevisionRecord\newUpdatedRevisionRecord().

◆ hasSameContent()

MediaWiki\Revision\RevisionRecord::hasSameContent ( RevisionRecord  $rec)
Parameters
RevisionRecord$rec
Returns
bool True if this RevisionRecord is known to have same content as $rec. False if the content is different (or not known to be the same).

Definition at line 118 of file RevisionRecord.php.

References MediaWiki\Revision\RevisionRecord\getId(), MediaWiki\Revision\RevisionRecord\getSha1(), and MediaWiki\Revision\RevisionRecord\getSize().

Referenced by MediaWiki\Storage\DerivedPageDataUpdater\prepareContent().

◆ hasSlot()

MediaWiki\Revision\RevisionRecord::hasSlot (   $role)

Returns whether the given slot is defined in this revision.

Parameters
string$roleThe role name of the desired slot
Returns
bool

Definition at line 197 of file RevisionRecord.php.

Referenced by McrUndoAction\getNewRevision().

◆ isCurrent()

MediaWiki\Revision\RevisionRecord::isCurrent ( )

Checks whether the revision record is a stored current revision.

Since
1.35
Returns
bool

Reimplemented in MediaWiki\Revision\RevisionStoreRecord.

Definition at line 587 of file RevisionRecord.php.

Referenced by CategoryMembershipChangeJob\getCategoriesAtRev(), and DifferenceEngine\getRevisionHeader().

◆ isDeleted()

◆ isMinor()

MediaWiki\Revision\RevisionRecord::isMinor ( )

◆ isReadyForInsertion()

MediaWiki\Revision\RevisionRecord::isReadyForInsertion ( )

Returns whether this RevisionRecord is ready for insertion, that is, whether it contains all information needed to save it to the database.

This should trivially be true for RevisionRecords loaded from the database.

Note that this may return true even if getId() or getPage() return null or 0, since these are generally assigned while the revision is saved to the database, and may not be available before.

Returns
bool

Reimplemented in MediaWiki\Revision\RevisionStoreRecord, and MediaWiki\Revision\RevisionArchiveRecord.

Definition at line 568 of file RevisionRecord.php.

References MediaWiki\Revision\RevisionRecord\getComment(), MediaWiki\Revision\RevisionRecord\getTimestamp(), and MediaWiki\Revision\RevisionRecord\getUser().

Referenced by MediaWiki\Revision\RevisionStore\insertRevisionOn().

◆ userCan()

MediaWiki\Revision\RevisionRecord::userCan (   $field,
Authority  $performer 
)

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

MCR migration note: this corresponded to Revision::userCan

Parameters
int$fieldOne of self::DELETED_TEXT, self::DELETED_COMMENT, self::DELETED_USER
Authority$performeruser on who's behalf to check
Returns
bool

Reimplemented in MediaWiki\Revision\RevisionStoreRecord.

Definition at line 509 of file RevisionRecord.php.

References MediaWiki\Revision\RevisionRecord\getVisibility(), and MediaWiki\Revision\RevisionRecord\userCanBitfield().

Referenced by MediaWiki\Revision\RevisionRecord\audienceCan(), ApiQueryRevisionsBase\checkRevDel(), HistoryPager\curLink(), HistoryPager\diffButtons(), SpecialUndelete\getPageLink(), Linker\getRevDeleteLink(), HistoryPager\lastLink(), ChangesList\revDateLink(), Linker\revUserLink(), Linker\revUserTools(), and DifferenceEngine\userCanEdit().

◆ userCanBitfield()

static MediaWiki\Revision\RevisionRecord::userCanBitfield (   $bitfield,
  $field,
Authority  $performer,
PageIdentity  $page = 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.

MCR migration note: this replaced Revision::userCanBitfield

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
Authority$performeruser on who's behalf to check
PageIdentity | null$pageA PageIdentity object to check for per-page restrictions on, instead of just plain user rights
Returns
bool

Definition at line 529 of file RevisionRecord.php.

References MediaWiki\Permissions\Authority\authorizeRead(), MediaWiki\Permissions\Authority\isAllowedAny(), and wfDebug().

Referenced by MediaWiki\Revision\RevisionRecord\userCan().

Member Data Documentation

◆ $mComment

CommentStoreComment null MediaWiki\Revision\RevisionRecord::$mComment
protected

Definition at line 87 of file RevisionRecord.php.

Referenced by MediaWiki\Revision\RevisionRecord\getComment().

◆ $mDeleted

int MediaWiki\Revision\RevisionRecord::$mDeleted = 0
protected

using the DELETED_XXX and SUPPRESSED_XXX flags

Definition at line 79 of file RevisionRecord.php.

Referenced by MediaWiki\Revision\RevisionRecord\getVisibility().

◆ $mId

int null MediaWiki\Revision\RevisionRecord::$mId
protected

Definition at line 69 of file RevisionRecord.php.

Referenced by MediaWiki\Revision\RevisionRecord\getId().

◆ $mMinorEdit

bool MediaWiki\Revision\RevisionRecord::$mMinorEdit = false
protected

Definition at line 75 of file RevisionRecord.php.

Referenced by MediaWiki\Revision\RevisionRecord\isMinor().

◆ $mPage

PageIdentity MediaWiki\Revision\RevisionRecord::$mPage
protected

Definition at line 90 of file RevisionRecord.php.

Referenced by MediaWiki\Revision\RevisionRecord\getPage().

◆ $mPageId

int MediaWiki\Revision\RevisionRecord::$mPageId
protected

Definition at line 71 of file RevisionRecord.php.

Referenced by MediaWiki\Revision\RevisionRecord\getPageId().

◆ $mParentId

int null MediaWiki\Revision\RevisionRecord::$mParentId
protected

Definition at line 85 of file RevisionRecord.php.

Referenced by MediaWiki\Revision\RevisionRecord\getParentId().

◆ $mSha1

string null MediaWiki\Revision\RevisionRecord::$mSha1
protected

◆ $mSize

int null MediaWiki\Revision\RevisionRecord::$mSize
protected

◆ $mSlots

RevisionSlots MediaWiki\Revision\RevisionRecord::$mSlots
protected

Definition at line 93 of file RevisionRecord.php.

Referenced by MediaWiki\Revision\RevisionRecord\getSlots().

◆ $mTimestamp

string null MediaWiki\Revision\RevisionRecord::$mTimestamp
protected

Definition at line 77 of file RevisionRecord.php.

Referenced by MediaWiki\Revision\RevisionRecord\getTimestamp().

◆ $mUser

UserIdentity null MediaWiki\Revision\RevisionRecord::$mUser
protected

Definition at line 73 of file RevisionRecord.php.

Referenced by MediaWiki\Revision\RevisionRecord\getUser().

◆ $wikiId

◆ DELETED_COMMENT

const MediaWiki\Revision\RevisionRecord::DELETED_COMMENT = 2

◆ DELETED_RESTRICTED

const MediaWiki\Revision\RevisionRecord::DELETED_RESTRICTED = 8

◆ DELETED_TEXT

◆ DELETED_USER

◆ FOR_PUBLIC

◆ FOR_THIS_USER

◆ RAW

◆ SUPPRESSED_ALL

const MediaWiki\Revision\RevisionRecord::SUPPRESSED_ALL
Initial value:
= self::DELETED_TEXT | self::DELETED_COMMENT | self::DELETED_USER |
self::DELETED_RESTRICTED

Definition at line 58 of file RevisionRecord.php.

Referenced by Page\DeletePage\archiveRevisions().

◆ SUPPRESSED_USER

const MediaWiki\Revision\RevisionRecord::SUPPRESSED_USER = self::DELETED_USER | self::DELETED_RESTRICTED

Definition at line 57 of file RevisionRecord.php.


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