MediaWiki
1.34.0
|
A cached RevisionStoreRecord. More...
Public Member Functions | |
__construct ( $callback, Title $title, UserIdentity $user, CommentStoreComment $comment, $row, RevisionSlots $slots, $dbDomain=false) | |
getUser ( $audience=self::FOR_PUBLIC, User $user=null) | |
Overridden to ensure that we return a fresh value and not a cached one. More... | |
getVisibility () | |
Overridden to ensure that we return a fresh value and not a cached one. More... | |
Public Member Functions inherited from Revision\RevisionStoreRecord | |
__construct (Title $title, UserIdentity $user, CommentStoreComment $comment, $row, RevisionSlots $slots, $dbDomain=false) | |
getComment ( $audience=self::FOR_PUBLIC, User $user=null) | |
getId () | |
getSha1 () | |
getSize () | |
getTimestamp () | |
isCurrent () | |
MCR migration note: this replaces Revision::isCurrent. More... | |
isDeleted ( $field) | |
MCR migration note: this replaces Revision::isDeleted. More... | |
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... | |
getContent ( $role, $audience=self::FOR_PUBLIC, User $user=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... | |
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... | |
getSlots () | |
Returns the slots defined for this 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... | |
Private Member Functions | |
loadFreshRow () | |
Load a fresh row from the database to ensure we return updated information. More... | |
Private Attributes | |
callable | $mCallback |
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\RevisionStoreRecord | |
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 Attributes inherited from Revision\RevisionStoreRecord | |
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 |
int | $mPageId |
int null | $mParentId |
string null | $mSha1 |
int null | $mSize |
RevisionSlots | $mSlots |
string null | $mTimestamp |
Title | $mTitle |
UserIdentity null | $mUser |
string false | $mWiki = false |
Wiki ID; false means the current wiki. More... | |
A cached RevisionStoreRecord.
Ensures that changes performed "behind the back" of the cache do not cause the revision record to deliver stale data.
Definition at line 38 of file RevisionStoreCacheRecord.php.
Revision\RevisionStoreCacheRecord::__construct | ( | $callback, | |
Title | $title, | ||
UserIdentity | $user, | ||
CommentStoreComment | $comment, | ||
$row, | |||
RevisionSlots | $slots, | ||
$dbDomain = false |
|||
) |
callable | $callback | Callback for loading data. Signature: function ( $id ): object |
Title | $title | The title of the page this Revision is associated with. |
UserIdentity | $user | |
CommentStoreComment | $comment | |
object | $row | A row from the revision table. Use RevisionStore::getQueryInfo() to build a query that yields the required fields. |
RevisionSlots | $slots | The slots of this revision. |
bool | string | $dbDomain | DB domain of the relevant wiki or false for the current one. |
Definition at line 58 of file RevisionStoreCacheRecord.php.
References $title.
Revision\RevisionStoreCacheRecord::getUser | ( | $audience = self::FOR_PUBLIC , |
|
User | $user = null |
||
) |
Overridden to ensure that we return a fresh value and not a cached one.
int | $audience | |
User | null | $user |
Reimplemented from Revision\RevisionStoreRecord.
Definition at line 91 of file RevisionStoreCacheRecord.php.
References getUser(), and Revision\RevisionStoreCacheRecord\loadFreshRow().
Revision\RevisionStoreCacheRecord::getVisibility | ( | ) |
Overridden to ensure that we return a fresh value and not a cached one.
Reimplemented from Revision\RevisionRecord.
Definition at line 76 of file RevisionStoreCacheRecord.php.
References Revision\RevisionStoreCacheRecord\loadFreshRow().
|
private |
Load a fresh row from the database to ensure we return updated information.
RevisionAccessException | if the row could not be loaded |
Definition at line 103 of file RevisionStoreCacheRecord.php.
References User\newFromAnyId(), and wfWarn().
Referenced by Revision\RevisionStoreCacheRecord\getUser(), and Revision\RevisionStoreCacheRecord\getVisibility().
|
private |
Definition at line 43 of file RevisionStoreCacheRecord.php.