MediaWiki  REL1_31
MediaWiki\Storage\RevisionStoreRecord Class Reference

A RevisionRecord representing an existing revision persisted in the revision table. More...

Inheritance diagram for MediaWiki\Storage\RevisionStoreRecord:
Collaboration diagram for MediaWiki\Storage\RevisionStoreRecord:

Public Member Functions

 __construct (Title $title, UserIdentity $user, CommentStoreComment $comment, $row, RevisionSlots $slots, $wikiId=false)
 
 getComment ( $audience=self::FOR_PUBLIC, User $user=null)
 
 getId ()
 
 getSha1 ()
 
 getSize ()
 
 getTimestamp ()
 
 getUser ( $audience=self::FOR_PUBLIC, User $user=null)
 
 isCurrent ()
 MCR migration note: this replaces Revision::isCurrent. More...
 
 isDeleted ( $field)
 MCR migration note: this replaces Revision::isDeleted. More...
 
- Public Member Functions inherited from MediaWiki\Storage\RevisionRecord
 __construct (Title $title, RevisionSlots $slots, $wikiId=false)
 
 __sleep ()
 Implemented to defy serialization. More...
 
 getContent ( $role, $audience=self::FOR_PUBLIC, User $user=null)
 Returns the Content of the given slot of 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...
 
 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...
 
 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...
 
 isMinor ()
 MCR migration note: this replaces Revision::isMinor. More...
 

Protected Member Functions

 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...
 
- Protected Member Functions inherited from MediaWiki\Storage\RevisionRecord
 audienceCan ( $field, $audience, User $user=null)
 Check that the given audience has access to the given field. More...
 

Protected Attributes

bool $mCurrent = false
 
- Protected Attributes inherited from MediaWiki\Storage\RevisionRecord
CommentStoreComment null $mComment
 
int $mDeleted = 0
 using the DELETED_XXX and SUPPRESSED_XXX flags More...
 
int null $mId
 
bool $mMinorEdit = false
 
int null $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 MediaWiki\Storage\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 MediaWiki\Storage\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 = 15
 
const SUPPRESSED_USER = 12
 

Detailed Description

A RevisionRecord representing an existing revision persisted in the revision table.

RevisionStoreRecord has no optional fields, getters will never return null.

Since
1.31

Definition at line 38 of file RevisionStoreRecord.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Storage\RevisionStoreRecord::__construct ( Title  $title,
UserIdentity  $user,
CommentStoreComment  $comment,
  $row,
RevisionSlots  $slots,
  $wikiId = 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$rowA row from the revision table. Use RevisionStore::getQueryInfo() to build a query that yields the required fields.
RevisionSlots$slotsThe slots of this revision.
bool | string$wikiIdthe wiki ID of the site this Revision belongs to, or false for the local site.

Definition at line 56 of file RevisionStoreRecord.php.

References $title, $user, and wfTimestamp().

Member Function Documentation

◆ getComment()

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

Reimplemented from MediaWiki\Storage\RevisionRecord.

Definition at line 197 of file RevisionStoreRecord.php.

References $user.

◆ getId()

MediaWiki\Storage\RevisionStoreRecord::getId ( )
Returns
int The revision id, never null.

Reimplemented from MediaWiki\Storage\RevisionRecord.

Definition at line 147 of file RevisionStoreRecord.php.

◆ getSha1()

MediaWiki\Storage\RevisionStoreRecord::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\Storage\RevisionRecord.

Definition at line 170 of file RevisionStoreRecord.php.

References MediaWiki\Storage\RevisionRecord\$mSha1.

◆ getSize()

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

Reimplemented from MediaWiki\Storage\RevisionRecord.

Definition at line 156 of file RevisionStoreRecord.php.

References MediaWiki\Storage\RevisionRecord\$mSize.

◆ getTimestamp()

MediaWiki\Storage\RevisionStoreRecord::getTimestamp ( )
Returns
string timestamp, never null

Reimplemented from MediaWiki\Storage\RevisionRecord.

Definition at line 205 of file RevisionStoreRecord.php.

◆ getUser()

MediaWiki\Storage\RevisionStoreRecord::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.

Reimplemented from MediaWiki\Storage\RevisionRecord.

Definition at line 186 of file RevisionStoreRecord.php.

References $user.

◆ isCurrent()

MediaWiki\Storage\RevisionStoreRecord::isCurrent ( )

◆ isDeleted()

MediaWiki\Storage\RevisionStoreRecord::isDeleted (   $field)

MCR migration note: this replaces Revision::isDeleted.

Parameters
int$fieldOne of DELETED_* bitfield constants
Returns
bool

Reimplemented from MediaWiki\Storage\RevisionRecord.

Definition at line 122 of file RevisionStoreRecord.php.

References MediaWiki\Storage\RevisionStoreRecord\isCurrent().

◆ userCan()

MediaWiki\Storage\RevisionStoreRecord::userCan (   $field,
User  $user 
)
protected

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

MCR migration note: this corresponds to Revision::userCan

Parameters
int$fieldOne of self::DELETED_TEXT, self::DELETED_COMMENT, self::DELETED_USER
User$userUser object to check
Returns
bool

Reimplemented from MediaWiki\Storage\RevisionRecord.

Definition at line 133 of file RevisionStoreRecord.php.

References $user, and MediaWiki\Storage\RevisionStoreRecord\isCurrent().

Member Data Documentation

◆ $mCurrent

bool MediaWiki\Storage\RevisionStoreRecord::$mCurrent = false
protected

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