MediaWiki REL1_37
MediaWiki\Revision\RevisionArchiveRecord Class Reference

A RevisionRecord representing a revision of a deleted page persisted in the archive table. More...

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

Public Member Functions

 __construct (PageIdentity $page, UserIdentity $user, CommentStoreComment $comment, stdClass $row, RevisionSlots $slots, $wikiId=self::LOCAL)
 
 getArchiveId ()
 Get archive row ID.
 
 getComment ( $audience=self::FOR_PUBLIC, Authority $performer=null)
 
 getId ( $wikiId=self::LOCAL)
 
 getSha1 ()
 
 getSize ()
 
 getTimestamp ()
 
 getUser ( $audience=self::FOR_PUBLIC, Authority $performer=null)
 
 isReadyForInsertion ()
 
- Public Member Functions inherited from MediaWiki\Revision\RevisionRecord
 __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.
 
 getContent ( $role, $audience=self::FOR_PUBLIC, Authority $performer=null)
 Returns the Content of the given slot of this revision.
 
 getInheritedSlots ()
 Returns slots inherited from some previous revision.
 
 getOriginalSlots ()
 Returns the slots that originate in this revision.
 
 getPage ()
 Returns the page this revision belongs to.
 
 getPageAsLinkTarget ()
 Returns the title of the page this revision is associated with as a LinkTarget object.
 
 getPageId ( $wikiId=self::LOCAL)
 Get the page ID.
 
 getParentId ( $wikiId=self::LOCAL)
 Get parent revision ID (the original previous page revision).
 
 getPrimarySlots ()
 Returns primary slots (those that are not derived).
 
 getSlot ( $role, $audience=self::FOR_PUBLIC, Authority $performer=null)
 Returns meta-data for the given slot.
 
 getSlotRoles ()
 Returns the slot names (roles) of all slots present in this revision.
 
 getSlots ()
 Returns the slots defined for this revision.
 
 getVisibility ()
 Get the deletion bitfield of the revision.
 
 getWikiId ()
 Get the ID of the wiki this revision belongs to.
 
 hasSameContent (RevisionRecord $rec)
 
 hasSlot ( $role)
 Returns whether the given slot is defined in this revision.
 
 isCurrent ()
 Checks whether the revision record is a stored current revision.
 
 isDeleted ( $field)
 MCR migration note: this replaced Revision::isDeleted.
 
 isMinor ()
 MCR migration note: this replaced Revision::isMinor.
 
 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.
 
- Public Member Functions inherited from MediaWiki\DAO\WikiAwareEntity
 assertWiki ( $wikiId)
 Throws if $wikiId is different from the return value of getWikiId().
 

Protected Attributes

int $mArchiveId
 
- Protected Attributes inherited from MediaWiki\Revision\RevisionRecord
CommentStoreComment null $mComment
 
int $mDeleted = 0
 using the DELETED_XXX and SUPPRESSED_XXX flags
 
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.
 

Additional Inherited Members

- Static Public Member Functions inherited from MediaWiki\Revision\RevisionRecord
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.
 
- Public Attributes inherited from MediaWiki\Revision\RevisionRecord
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
 

Detailed Description

A RevisionRecord representing a revision of a deleted page persisted in the archive table.

Most getters on RevisionArchiveRecord will never return null. However, getId() and getParentId() may indeed return null if this information was not stored when the archive entry was created.

Since
1.31
1.32 Renamed from MediaWiki\Storage\RevisionArchiveRecord

Definition at line 42 of file RevisionArchiveRecord.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Revision\RevisionArchiveRecord::__construct ( PageIdentity  $page,
UserIdentity  $user,
CommentStoreComment  $comment,
stdClass  $row,
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.
UserIdentity$user
CommentStoreComment$comment
stdClass$rowAn archive table row. Use RevisionStore::getArchiveQueryInfo() to build a query that yields the required fields.
RevisionSlots$slotsThe slots of this revision.
false | string$wikiIdRelevant wiki or self::LOCAL for the current one.

Definition at line 61 of file RevisionArchiveRecord.php.

References MediaWiki\Revision\RevisionRecord\$wikiId.

Member Function Documentation

◆ getArchiveId()

MediaWiki\Revision\RevisionArchiveRecord::getArchiveId ( )

Get archive row ID.

Returns
int

Definition at line 100 of file RevisionArchiveRecord.php.

References MediaWiki\Revision\RevisionArchiveRecord\$mArchiveId.

◆ getComment()

MediaWiki\Revision\RevisionArchiveRecord::getComment (   $audience = self::FOR_PUBLIC,
Authority  $performer = null 
)
Parameters
int$audience
Authority | null$performer
Returns
CommentStoreComment The revision comment, null if access is forbidden.

Reimplemented from MediaWiki\Revision\RevisionRecord.

Definition at line 159 of file RevisionArchiveRecord.php.

◆ getId()

MediaWiki\Revision\RevisionArchiveRecord::getId (   $wikiId = self::LOCAL)
Parameters
string | false$wikiIdThe wiki ID expected by the caller.
Returns
int|null The revision id, or null if the original revision ID was not recorded in the archive table.

Reimplemented from MediaWiki\Revision\RevisionRecord.

Definition at line 109 of file RevisionArchiveRecord.php.

References MediaWiki\Revision\RevisionRecord\$wikiId.

◆ getSha1()

MediaWiki\Revision\RevisionArchiveRecord::getSha1 ( )
Exceptions
RevisionAccessExceptionif the hash was unknown and could not be calculated.
Returns
string The revision hash, never null. May be computed on the fly.

Reimplemented from MediaWiki\Revision\RevisionRecord.

Definition at line 132 of file RevisionArchiveRecord.php.

References MediaWiki\Revision\RevisionRecord\$mSha1.

◆ getSize()

MediaWiki\Revision\RevisionArchiveRecord::getSize ( )
Exceptions
RevisionAccessExceptionif the size was unknown and could not be calculated.
Returns
int The nominal revision size, never null. May be computed on the fly.

Reimplemented from MediaWiki\Revision\RevisionRecord.

Definition at line 118 of file RevisionArchiveRecord.php.

References MediaWiki\Revision\RevisionRecord\$mSize.

◆ getTimestamp()

MediaWiki\Revision\RevisionArchiveRecord::getTimestamp ( )
Returns
string never null

Reimplemented from MediaWiki\Revision\RevisionRecord.

Definition at line 167 of file RevisionArchiveRecord.php.

◆ getUser()

MediaWiki\Revision\RevisionArchiveRecord::getUser (   $audience = self::FOR_PUBLIC,
Authority  $performer = null 
)
Parameters
int$audience
Authority | null$performer
Returns
UserIdentity The identity of the revision author, null if access is forbidden.

Reimplemented from MediaWiki\Revision\RevisionRecord.

Definition at line 148 of file RevisionArchiveRecord.php.

◆ isReadyForInsertion()

MediaWiki\Revision\RevisionArchiveRecord::isReadyForInsertion ( )
See also
RevisionStore::isComplete
Returns
bool always true.

Reimplemented from MediaWiki\Revision\RevisionRecord.

Definition at line 177 of file RevisionArchiveRecord.php.

Member Data Documentation

◆ $mArchiveId

int MediaWiki\Revision\RevisionArchiveRecord::$mArchiveId
protected

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