MediaWiki  master
Revision\RevisionStoreRecord Class Reference

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

Inheritance diagram for Revision\RevisionStoreRecord:
Collaboration diagram for Revision\RevisionStoreRecord:

Public Member Functions

 __construct (PageIdentity $page, UserIdentity $user, CommentStoreComment $comment, $row, RevisionSlots $slots, $wikiId=self::LOCAL)
 
 getComment ( $audience=self::FOR_PUBLIC, Authority $performer=null)
 
 getId ( $wikiId=self::LOCAL)
 
 getSha1 ()
 
 getSize ()
 
 getTimestamp ()
 
 getUser ( $audience=self::FOR_PUBLIC, Authority $performer=null)
 
 isCurrent ()
 Checks whether the revision record is a stored current revision.
Since
1.35
Returns
bool
More...
 
 isDeleted ( $field)
 MCR migration note: this replaces Revision::isDeleted. More...
 
 isReadyForInsertion ()
 
 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 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. More...
 
 getContent ( $role, $audience=self::FOR_PUBLIC, Authority $performer=null)
 Returns the Content of the given slot of this revision. 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...
 
 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...
 
 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...
 
- Public Member Functions inherited from MediaWiki\DAO\WikiAwareEntity
 assertWiki ( $wikiId)
 Throws if $wikiId is different from the return value of getWikiId(). More...
 

Protected Attributes

bool $mCurrent = false
 
- 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
 
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from 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. 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
 

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
1.32 Renamed from MediaWiki\Storage\RevisionStoreRecord

Definition at line 40 of file RevisionStoreRecord.php.

Constructor & Destructor Documentation

◆ __construct()

Revision\RevisionStoreRecord::__construct ( PageIdentity  $page,
UserIdentity  $user,
CommentStoreComment  $comment,
  $row,
RevisionSlots  $slots,
  $wikiId = self::LOCAL 
)
Note
Avoid calling this constructor directly. Use the appropriate methods in RevisionStore instead.
Parameters
PageIdentity$pageThe page this Revision is associated with.
UserIdentity$user
CommentStoreComment$comment
\\stdClass$rowA row from the revision table. Use RevisionStore::getQueryInfo() to build a query that yields the required fields.
RevisionSlots$slotsThe slots of this revision.
false | string$wikiIdRelevant wiki id or self::LOCAL for the current one.

Definition at line 57 of file RevisionStoreRecord.php.

References Revision\RevisionRecord\$wikiId.

Member Function Documentation

◆ getComment()

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

Definition at line 199 of file RevisionStoreRecord.php.

◆ getId()

Revision\RevisionStoreRecord::getId (   $wikiId = self::LOCAL)
Parameters
string | false$wikiIdThe wiki ID expected by the caller.
Returns
int|null The revision id, never null.

Reimplemented from Revision\RevisionRecord.

Definition at line 149 of file RevisionStoreRecord.php.

References Revision\RevisionRecord\$wikiId.

◆ getSha1()

Revision\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 Revision\RevisionRecord.

Definition at line 172 of file RevisionStoreRecord.php.

References Revision\RevisionRecord\$mSha1.

◆ getSize()

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

Definition at line 158 of file RevisionStoreRecord.php.

References Revision\RevisionRecord\$mSize.

◆ getTimestamp()

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

Reimplemented from Revision\RevisionRecord.

Definition at line 207 of file RevisionStoreRecord.php.

References getTimestamp().

◆ getUser()

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

Reimplemented in Revision\RevisionStoreCacheRecord.

Definition at line 188 of file RevisionStoreRecord.php.

◆ isCurrent()

Revision\RevisionStoreRecord::isCurrent ( )

Checks whether the revision record is a stored current revision.

Since
1.35
Returns
bool

Reimplemented from Revision\RevisionRecord.

Definition at line 112 of file RevisionStoreRecord.php.

References Revision\RevisionStoreRecord\$mCurrent.

Referenced by Revision\RevisionStoreRecord\isDeleted(), and Revision\RevisionStoreRecord\userCan().

◆ isDeleted()

Revision\RevisionStoreRecord::isDeleted (   $field)

MCR migration note: this replaces Revision::isDeleted.

Parameters
int$fieldOne of DELETED_* bitfield constants
Returns
bool

Reimplemented from Revision\RevisionRecord.

Definition at line 123 of file RevisionStoreRecord.php.

References Revision\RevisionStoreRecord\isCurrent().

◆ isReadyForInsertion()

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

Reimplemented from Revision\RevisionRecord.

Definition at line 217 of file RevisionStoreRecord.php.

◆ userCan()

Revision\RevisionStoreRecord::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 corresponds 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 from Revision\RevisionRecord.

Definition at line 134 of file RevisionStoreRecord.php.

References Revision\RevisionStoreRecord\isCurrent().

Member Data Documentation

◆ $mCurrent

bool Revision\RevisionStoreRecord::$mCurrent = false
protected

Definition at line 43 of file RevisionStoreRecord.php.

Referenced by Revision\RevisionStoreRecord\isCurrent().


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