MediaWiki REL1_37
|
Builder class for the EditResult object. More...
Public Member Functions | |
__construct (RevisionStore $revisionStore, array $softwareTags, ServiceOptions $options) | |
buildEditResult () | |
markAsRevert (int $revertMethod, int $oldestRevertedRevId, int $newestRevertedRevId=0) | |
Marks this edit as a revert and applies relevant information. | |
setIsNew (bool $isNew) | |
Set whether the edit created a new page. | |
setOriginalRevisionId ( $originalRevId) | |
Sets the ID of an earlier revision that is being repeated or restored. | |
setRevisionRecord (RevisionRecord $revisionRecord) | |
Set the revision associated with this edit. | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Private Member Functions | |
detectManualRevert () | |
If this edit was not already marked as a revert using EditResultBuilder::markAsRevert(), tries to establish whether this was a manual revert, i.e. | |
getOriginalRevision (int $flags=RevisionStore::READ_NORMAL) | |
Returns the revision that is being repeated or restored. | |
getRevertTags () | |
Returns an array of revert-related tags that will be applied automatically to this edit. | |
isExactRevert () | |
Whether the edit was an exact revert, i.e. | |
isNullEdit () | |
An edit is a null edit if the original revision is equal to the parent revision. | |
Private Attributes | |
bool | $isNew = false |
int null | $newestRevertedRevId = null |
int null | $oldestRevertedRevId = null |
ServiceOptions | $options |
RevisionRecord null | $originalRevision = null |
bool int | $originalRevisionId = false |
int null | $revertMethod = null |
RevisionRecord null | $revisionRecord = null |
RevisionStore | $revisionStore |
string[] | $softwareTags |
const | REVERT_METHOD_TO_CHANGE_TAG |
A mapping from EditResult's revert methods to relevant change tags. | |
Builder class for the EditResult object.
Definition at line 37 of file EditResultBuilder.php.
MediaWiki\Storage\EditResultBuilder::__construct | ( | RevisionStore | $revisionStore, |
array | $softwareTags, | ||
ServiceOptions | $options | ||
) |
RevisionStore | $revisionStore | |
string[] | $softwareTags | Array of currently enabled software change tags. Can be obtained from ChangeTags::getSoftwareTags() |
ServiceOptions | $options | Options for this instance. |
Definition at line 89 of file EditResultBuilder.php.
References MediaWiki\Storage\EditResultBuilder\$options, MediaWiki\Storage\EditResultBuilder\$revisionStore, MediaWiki\Storage\EditResultBuilder\$softwareTags, and MediaWiki\Config\ServiceOptions\assertRequiredOptions().
MediaWiki\Storage\EditResultBuilder::buildEditResult | ( | ) |
Definition at line 104 of file EditResultBuilder.php.
|
private |
If this edit was not already marked as a revert using EditResultBuilder::markAsRevert(), tries to establish whether this was a manual revert, i.e.
someone restored the page to an exact previous state manually.
If successful, mutates the builder accordingly.
Definition at line 189 of file EditResultBuilder.php.
References MediaWiki\Storage\EditResult\REVERT_MANUAL.
|
private |
Returns the revision that is being repeated or restored.
Returns null if not set for this edit.
int | $flags | Access flags, e.g. RevisionStore::READ_LATEST |
Definition at line 231 of file EditResultBuilder.php.
|
private |
Returns an array of revert-related tags that will be applied automatically to this edit.
Definition at line 286 of file EditResultBuilder.php.
|
private |
Whether the edit was an exact revert, i.e.
the contents of the revert revision and restored revision match
Definition at line 254 of file EditResultBuilder.php.
|
private |
An edit is a null edit if the original revision is equal to the parent revision.
Definition at line 272 of file EditResultBuilder.php.
MediaWiki\Storage\EditResultBuilder::markAsRevert | ( | int | $revertMethod, |
int | $oldestRevertedRevId, | ||
int | $newestRevertedRevId = 0 |
||
) |
Marks this edit as a revert and applies relevant information.
Will do nothing if $oldestRevertedRevId is 0.
int | $revertMethod | The method used to make the revert: REVERT_UNDO, REVERT_ROLLBACK or REVERT_MANUAL |
int | $oldestRevertedRevId | The ID of the oldest revision that was reverted. |
int | $newestRevertedRevId | The ID of the newest revision that was reverted. This parameter is optional, default value is $oldestRevertedRevId |
Definition at line 156 of file EditResultBuilder.php.
MediaWiki\Storage\EditResultBuilder::setIsNew | ( | bool | $isNew | ) |
Set whether the edit created a new page.
Should only be called by PageUpdater when saving an edit.
bool | $isNew |
Definition at line 142 of file EditResultBuilder.php.
MediaWiki\Storage\EditResultBuilder::setOriginalRevisionId | ( | $originalRevId | ) |
Sets the ID of an earlier revision that is being repeated or restored.
int | bool | $originalRevId |
Definition at line 178 of file EditResultBuilder.php.
MediaWiki\Storage\EditResultBuilder::setRevisionRecord | ( | RevisionRecord | $revisionRecord | ) |
Set the revision associated with this edit.
Should only be called by PageUpdater when saving an edit.
RevisionRecord | $revisionRecord |
Definition at line 132 of file EditResultBuilder.php.
|
private |
Definition at line 57 of file EditResultBuilder.php.
|
private |
Definition at line 69 of file EditResultBuilder.php.
|
private |
Definition at line 72 of file EditResultBuilder.php.
|
private |
Definition at line 81 of file EditResultBuilder.php.
Referenced by MediaWiki\Storage\EditResultBuilder\__construct().
|
private |
Definition at line 63 of file EditResultBuilder.php.
|
private |
Definition at line 60 of file EditResultBuilder.php.
|
private |
Definition at line 66 of file EditResultBuilder.php.
|
private |
Definition at line 54 of file EditResultBuilder.php.
|
private |
Definition at line 75 of file EditResultBuilder.php.
Referenced by MediaWiki\Storage\EditResultBuilder\__construct().
|
private |
Definition at line 78 of file EditResultBuilder.php.
Referenced by MediaWiki\Storage\EditResultBuilder\__construct().
const MediaWiki\Storage\EditResultBuilder::CONSTRUCTOR_OPTIONS |
Definition at line 39 of file EditResultBuilder.php.
Referenced by MediaWiki\Storage\PageUpdater\__construct().
|
private |
A mapping from EditResult's revert methods to relevant change tags.
For use by getRevertTags()
Definition at line 47 of file EditResultBuilder.php.