MediaWiki  master
Revision\RevisionArchiveRecord Class Reference

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

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

Public Member Functions

 __construct (Title $title, UserIdentity $user, CommentStoreComment $comment, $row, RevisionSlots $slots, $dbDomain=false)
 
 getArchiveId ()
 Get archive row ID. More...
 
 getComment ( $audience=self::FOR_PUBLIC, User $user=null)
 
 getId ()
 
 getSha1 ()
 
 getSize ()
 
 getTimestamp ()
 
 getUser ( $audience=self::FOR_PUBLIC, User $user=null)
 
 isReadyForInsertion ()
 
- Public Member Functions inherited from Revision\RevisionRecord
 __construct (Title $title, RevisionSlots $slots, $dbDomain=false)
 
 __sleep ()
 Implemented to defy serialization. More...
 
 audienceCan ( $field, $audience, User $user=null)
 Check that the given audience has access to the given field. More...
 
 getComment ( $audience=self::FOR_PUBLIC, User $user=null)
 Fetch revision comment, if it's available to the specified audience. More...
 
 getContent ( $role, $audience=self::FOR_PUBLIC, User $user=null)
 Returns the Content of the given slot of this revision. More...
 
 getId ()
 Get revision ID. More...
 
 getInheritedSlots ()
 Returns slots inherited from some previous revision. More...
 
 getOriginalSlots ()
 Returns the slots that originate in this revision. More...
 
 getPageAsLinkTarget ()
 Returns the title of the page this revision is associated with as a LinkTarget object. More...
 
 getPageId ()
 Get the page ID. More...
 
 getParentId ()
 Get parent revision ID (the original previous page revision). 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, User $user=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 replaces Revision::getTimestamp. More...
 
 getUser ( $audience=self::FOR_PUBLIC, User $user=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...
 
 isDeleted ( $field)
 MCR migration note: this replaces Revision::isDeleted. More...
 
 isMinor ()
 MCR migration note: this replaces 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...
 

Protected Attributes

int $mArchiveId
 
- Protected Attributes inherited from Revision\RevisionRecord
CommentStoreComment null $mComment
 
int $mDeleted = 0
 using the DELETED_XXX and SUPPRESSED_XXX flags More...
 
int null $mId
 
bool $mMinorEdit = false
 
int $mPageId
 
int null $mParentId
 
string null $mSha1
 
int null $mSize
 
RevisionSlots $mSlots
 
string null $mTimestamp
 
Title $mTitle
 
UserIdentity null $mUser
 
string $mWiki = false
 Wiki ID; false means the current wiki. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Revision\RevisionRecord
static userCanBitfield ( $bitfield, $field, User $user, Title $title=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 inherited from 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
 
- Protected Member Functions inherited from Revision\RevisionRecord
 userCan ( $field, User $user)
 Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted. More...
 

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 40 of file RevisionArchiveRecord.php.

Constructor & Destructor Documentation

◆ __construct()

Revision\RevisionArchiveRecord::__construct ( Title  $title,
UserIdentity  $user,
CommentStoreComment  $comment,
  $row,
RevisionSlots  $slots,
  $dbDomain = false 
)
Note
Avoid calling this constructor directly. Use the appropriate methods in RevisionStore instead.
Parameters
Title$titleThe title of the page this Revision is associated with.
UserIdentity$user
CommentStoreComment$comment
object$rowAn archive table row. Use RevisionStore::getArchiveQueryInfo() to build a query that yields the required fields.
RevisionSlots$slotsThe slots of this revision.
bool | string$dbDomainDB domain of the relevant wiki or false for the current one.

Definition at line 59 of file RevisionArchiveRecord.php.

References $user, Title\getArticleID(), null, and wfTimestamp().

Member Function Documentation

◆ getArchiveId()

Revision\RevisionArchiveRecord::getArchiveId ( )

Get archive row ID.

Returns
int

Definition at line 99 of file RevisionArchiveRecord.php.

References Revision\RevisionArchiveRecord\$mArchiveId.

◆ getComment()

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

Definition at line 157 of file RevisionArchiveRecord.php.

References $user.

◆ getId()

Revision\RevisionArchiveRecord::getId ( )
Returns
int|null The revision id, or null if the original revision ID was not recorded in the archive table.

Definition at line 107 of file RevisionArchiveRecord.php.

◆ getSha1()

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.

Definition at line 130 of file RevisionArchiveRecord.php.

References Revision\RevisionRecord\$mSha1, and null.

◆ getSize()

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.

Definition at line 116 of file RevisionArchiveRecord.php.

References Revision\RevisionRecord\$mSize, and null.

◆ getTimestamp()

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

Definition at line 165 of file RevisionArchiveRecord.php.

◆ getUser()

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

Definition at line 146 of file RevisionArchiveRecord.php.

References $user.

◆ isReadyForInsertion()

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

Definition at line 175 of file RevisionArchiveRecord.php.

References class.

Member Data Documentation

◆ $mArchiveId

int Revision\RevisionArchiveRecord::$mArchiveId
protected

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