MediaWiki REL1_34
|
Public Member Functions | |
__construct (Title $title, $dbDomain=false) | |
applyUpdate (RevisionSlotsUpdate $update) | |
Applies the given update to the slots of this revision. | |
getSha1 () | |
Returns the base36 sha1 of this revision. | |
getSize () | |
Returns the nominal size of this revision. | |
getSlots () | |
Returns the slots defined for this revision as a MutableRevisionSlots instance, which can be modified to defined the slots for this revision. | |
inheritSlot (SlotRecord $parentSlot) | |
"Inherits" the given slot's content. | |
removeSlot ( $role) | |
Removes the slot with the given role from this revision. | |
setComment (CommentStoreComment $comment) | |
setContent ( $role, Content $content) | |
Sets the content for the slot with the given role. | |
setId ( $id) | |
Set the revision ID. | |
setMinorEdit ( $minorEdit) | |
setPageId ( $pageId) | |
setParentId ( $parentId) | |
setSha1 ( $sha1) | |
Set revision hash, for optimization. | |
setSize ( $size) | |
Set nominal revision size, for optimization. | |
setSlot (SlotRecord $slot) | |
Sets the given slot. | |
setTimestamp ( $timestamp) | |
setUser (UserIdentity $user) | |
Sets the user identity associated with the revision. | |
setVisibility ( $visibility) | |
Public Member Functions inherited from MediaWiki\Revision\RevisionRecord | |
__construct (Title $title, RevisionSlots $slots, $dbDomain=false) | |
__sleep () | |
Implemented to defy serialization. | |
audienceCan ( $field, $audience, User $user=null) | |
Check that the given audience has access to the given field. | |
getComment ( $audience=self::FOR_PUBLIC, User $user=null) | |
Fetch revision comment, if it's available to the specified audience. | |
getContent ( $role, $audience=self::FOR_PUBLIC, User $user=null) | |
Returns the Content of the given slot of this revision. | |
getId () | |
Get revision ID. | |
getInheritedSlots () | |
Returns slots inherited from some previous revision. | |
getOriginalSlots () | |
Returns the slots that originate in this revision. | |
getPageAsLinkTarget () | |
Returns the title of the page this revision is associated with as a LinkTarget object. | |
getPageId () | |
Get the page ID. | |
getParentId () | |
Get parent revision ID (the original previous page revision). | |
getSlot ( $role, $audience=self::FOR_PUBLIC, User $user=null) | |
Returns meta-data for the given slot. | |
getSlotRoles () | |
Returns the slot names (roles) of all slots present in this revision. | |
getTimestamp () | |
MCR migration note: this replaces Revision::getTimestamp. | |
getUser ( $audience=self::FOR_PUBLIC, User $user=null) | |
Fetch revision's author's user identity, if it's available to the specified audience. | |
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. | |
isDeleted ( $field) | |
MCR migration note: this replaces Revision::isDeleted. | |
isMinor () | |
MCR migration note: this replaces Revision::isMinor. | |
isReadyForInsertion () | |
Returns whether this RevisionRecord is ready for insertion, that is, whether it contains all information needed to save it to the database. | |
Static Public Member Functions | |
static | newFromParentRevision (RevisionRecord $parent) |
Returns an incomplete MutableRevisionRecord which uses $parent as its parent revision, and inherits all slots form it. | |
Static Public Member Functions inherited from MediaWiki\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. | |
Private Member Functions | |
resetAggregateValues () | |
Invalidate cached aggregate values such as hash and size. | |
Additional Inherited Members | |
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 |
Protected Member Functions inherited from MediaWiki\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. | |
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 |
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. | |
Definition at line 42 of file MutableRevisionRecord.php.
MediaWiki\Revision\MutableRevisionRecord::__construct | ( | Title | $title, |
$dbDomain = false |
|||
) |
Title | $title | The title of the page this Revision is associated with. |
bool | string | $dbDomain | DB domain of the relevant wiki or false for the current one. |
MWException |
Definition at line 78 of file MutableRevisionRecord.php.
References $title.
MediaWiki\Revision\MutableRevisionRecord::applyUpdate | ( | RevisionSlotsUpdate | $update | ) |
Applies the given update to the slots of this revision.
RevisionSlotsUpdate | $update |
Definition at line 176 of file MutableRevisionRecord.php.
References MediaWiki\Storage\RevisionSlotsUpdate\apply().
MediaWiki\Revision\MutableRevisionRecord::getSha1 | ( | ) |
Returns the base36 sha1 of this revision.
MCR migration note: this replaces Revision::getSha1
Reimplemented from MediaWiki\Revision\RevisionRecord.
Definition at line 308 of file MutableRevisionRecord.php.
References MediaWiki\Revision\RevisionRecord\$mSha1.
MediaWiki\Revision\MutableRevisionRecord::getSize | ( | ) |
Returns the nominal size of this revision.
MCR migration note: this replaces Revision::getSize
Reimplemented from MediaWiki\Revision\RevisionRecord.
Definition at line 292 of file MutableRevisionRecord.php.
References MediaWiki\Revision\RevisionRecord\$mSize.
MediaWiki\Revision\MutableRevisionRecord::getSlots | ( | ) |
Returns the slots defined for this revision as a MutableRevisionSlots instance, which can be modified to defined the slots for this revision.
Reimplemented from MediaWiki\Revision\RevisionRecord.
Definition at line 323 of file MutableRevisionRecord.php.
MediaWiki\Revision\MutableRevisionRecord::inheritSlot | ( | SlotRecord | $parentSlot | ) |
"Inherits" the given slot's content.
If a slot with the same role is already present in the revision, it is replaced.
SlotRecord | $parentSlot |
Definition at line 130 of file MutableRevisionRecord.php.
References MediaWiki\Revision\MutableRevisionRecord\resetAggregateValues().
|
static |
Returns an incomplete MutableRevisionRecord which uses $parent as its parent revision, and inherits all slots form it.
If saved unchanged, the new revision will act as a null-revision.
RevisionRecord | $parent |
Definition at line 53 of file MutableRevisionRecord.php.
References $title, MediaWiki\Revision\RevisionRecord\getId(), MediaWiki\Revision\RevisionRecord\getPageAsLinkTarget(), MediaWiki\Revision\RevisionRecord\getPageId(), MediaWiki\Revision\RevisionRecord\getSlot(), MediaWiki\Revision\RevisionRecord\getSlotRoles(), and MediaWiki\Revision\RevisionRecord\getWikiId().
Referenced by MediaWiki\Revision\RevisionStore\newNullRevision().
MediaWiki\Revision\MutableRevisionRecord::removeSlot | ( | $role | ) |
Removes the slot with the given role from this revision.
This effectively ends the "stream" with that role on the revision's page. Future revisions will no longer inherit this slot, unless it is added back explicitly.
string | $role |
Definition at line 166 of file MutableRevisionRecord.php.
References MediaWiki\Revision\MutableRevisionRecord\resetAggregateValues().
|
private |
Invalidate cached aggregate values such as hash and size.
Definition at line 331 of file MutableRevisionRecord.php.
Referenced by MediaWiki\Revision\MutableRevisionRecord\inheritSlot(), MediaWiki\Revision\MutableRevisionRecord\removeSlot(), MediaWiki\Revision\MutableRevisionRecord\setContent(), and MediaWiki\Revision\MutableRevisionRecord\setSlot().
MediaWiki\Revision\MutableRevisionRecord::setComment | ( | CommentStoreComment | $comment | ) |
CommentStoreComment | $comment |
Definition at line 183 of file MutableRevisionRecord.php.
Referenced by MediaWiki\Revision\RevisionStore\initializeMutableRevisionFromArray().
MediaWiki\Revision\MutableRevisionRecord::setContent | ( | $role, | |
Content | $content | ||
) |
Sets the content for the slot with the given role.
If a slot with the same role is already present in the revision, it is replaced. Calling code that has access to a SlotRecord can use inheritSlot() instead.
string | $role | |
Content | $content |
Definition at line 149 of file MutableRevisionRecord.php.
References $content, and MediaWiki\Revision\MutableRevisionRecord\resetAggregateValues().
MediaWiki\Revision\MutableRevisionRecord::setId | ( | $id | ) |
Set the revision ID.
MCR migration note: this replaces Revision::setId()
int | $id |
Definition at line 255 of file MutableRevisionRecord.php.
Referenced by MediaWiki\Revision\RevisionStore\initializeMutableRevisionFromArray().
MediaWiki\Revision\MutableRevisionRecord::setMinorEdit | ( | $minorEdit | ) |
bool | $minorEdit |
Definition at line 238 of file MutableRevisionRecord.php.
Referenced by MediaWiki\Revision\RevisionStore\initializeMutableRevisionFromArray().
MediaWiki\Revision\MutableRevisionRecord::setPageId | ( | $pageId | ) |
int | $pageId |
Definition at line 273 of file MutableRevisionRecord.php.
Referenced by MediaWiki\Revision\RevisionStore\initializeMutableRevisionFromArray().
MediaWiki\Revision\MutableRevisionRecord::setParentId | ( | $parentId | ) |
int | $parentId |
Definition at line 87 of file MutableRevisionRecord.php.
Referenced by MediaWiki\Revision\RevisionStore\initializeMutableRevisionFromArray().
MediaWiki\Revision\MutableRevisionRecord::setSha1 | ( | $sha1 | ) |
Set revision hash, for optimization.
Prevents getSha1() from re-calculating the hash.
string | $sha1 | SHA1 hash as a base36 string. |
Definition at line 196 of file MutableRevisionRecord.php.
Referenced by MediaWiki\Revision\RevisionStore\initializeMutableRevisionFromArray().
MediaWiki\Revision\MutableRevisionRecord::setSize | ( | $size | ) |
Set nominal revision size, for optimization.
Prevents getSize() from re-calculating the size.
int | $size | nominal size in bogo-bytes |
Definition at line 211 of file MutableRevisionRecord.php.
Referenced by MediaWiki\Revision\RevisionStore\initializeMutableRevisionFromArray().
MediaWiki\Revision\MutableRevisionRecord::setSlot | ( | SlotRecord | $slot | ) |
Sets the given slot.
If a slot with the same role is already present in the revision, it is replaced.
SlotRecord | $slot |
Definition at line 108 of file MutableRevisionRecord.php.
References MediaWiki\Revision\SlotRecord\getRevision(), MediaWiki\Revision\SlotRecord\hasRevision(), and MediaWiki\Revision\MutableRevisionRecord\resetAggregateValues().
MediaWiki\Revision\MutableRevisionRecord::setTimestamp | ( | $timestamp | ) |
string | $timestamp | A timestamp understood by wfTimestamp |
Definition at line 229 of file MutableRevisionRecord.php.
References wfTimestamp().
Referenced by MediaWiki\Revision\RevisionStore\initializeMutableRevisionFromArray().
MediaWiki\Revision\MutableRevisionRecord::setUser | ( | UserIdentity | $user | ) |
Sets the user identity associated with the revision.
UserIdentity | $user |
Definition at line 266 of file MutableRevisionRecord.php.
Referenced by MediaWiki\Revision\RevisionStore\initializeMutableRevisionFromArray().
MediaWiki\Revision\MutableRevisionRecord::setVisibility | ( | $visibility | ) |
int | $visibility |
Definition at line 220 of file MutableRevisionRecord.php.
Referenced by MediaWiki\Revision\RevisionStore\initializeMutableRevisionFromArray().