MediaWiki REL1_35
|
Object for storing information about the effects of an edit. More...
Public Member Functions | |
__construct (bool $isNew, $originalRevisionId, ?int $revertMethod, ?int $oldestReverted, ?int $newestReverted, bool $isExactRevert, bool $isNullEdit, array $revertTags) | |
EditResult constructor. | |
getNewestRevertedRevisionId () | |
Returns the ID of the most recent revision that was reverted by this edit. | |
getOldestRevertedRevisionId () | |
Returns the ID of the oldest revision that was reverted by this edit. | |
getOriginalRevisionId () | |
Returns the ID of an earlier revision that is being repeated or restored. | |
getRevertMethod () | |
Returns the revert method that was used to perform the edit, if any changes were reverted. | |
getRevertTags () | |
Returns an array of revert-related tags that were applied automatically to this edit. | |
getUndidRevId () | |
If the edit was an undo, returns the oldest revision that was undone. | |
isExactRevert () | |
Whether the edit was an exact revert, i.e. | |
isNew () | |
Whether the edit created a new page. | |
isNullEdit () | |
An edit is a null edit if the original revision is equal to the parent revision, i.e. | |
isRevert () | |
Whether the edit was a revert, not necessarily exact. | |
Public Attributes | |
const | REVERT_MANUAL = 3 |
const | REVERT_ROLLBACK = 2 |
const | REVERT_UNDO = 1 |
Private Attributes | |
bool | $isExactRevert |
bool | $isNew |
bool | $isNullEdit |
int null | $newestRevertedRevId |
int null | $oldestRevertedRevId |
bool int | $originalRevisionId |
int null | $revertMethod |
string[] | $revertTags |
Object for storing information about the effects of an edit.
This object should be constructed by an EditResultBuilder with relevant information filled in during the process of saving the revision by the PageUpdater. You can use it to extract information about whether the edit was a revert and which edits were reverted.
Definition at line 36 of file EditResult.php.
MediaWiki\Storage\EditResult::__construct | ( | bool | $isNew, |
$originalRevisionId, | |||
?int | $revertMethod, | ||
?int | $oldestReverted, | ||
?int | $newestReverted, | ||
bool | $isExactRevert, | ||
bool | $isNullEdit, | ||
array | $revertTags | ||
) |
EditResult constructor.
bool | $isNew | |
bool | int | $originalRevisionId | |
int | null | $revertMethod | |
int | null | $oldestReverted | |
int | null | $newestReverted | |
bool | $isExactRevert | |
bool | $isNullEdit | |
string[] | $revertTags |
Definition at line 81 of file EditResult.php.
References MediaWiki\Storage\EditResult\$isExactRevert, MediaWiki\Storage\EditResult\$isNew, MediaWiki\Storage\EditResult\$isNullEdit, MediaWiki\Storage\EditResult\$originalRevisionId, MediaWiki\Storage\EditResult\$revertMethod, MediaWiki\Storage\EditResult\$revertTags, MediaWiki\Storage\EditResult\isExactRevert(), MediaWiki\Storage\EditResult\isNew(), and MediaWiki\Storage\EditResult\isNullEdit().
MediaWiki\Storage\EditResult::getNewestRevertedRevisionId | ( | ) |
Returns the ID of the most recent revision that was reverted by this edit.
The same as getOldestRevertedRevisionId if only a single revision was reverted. Returns null if the edit was not a revert.
Definition at line 110 of file EditResult.php.
MediaWiki\Storage\EditResult::getOldestRevertedRevisionId | ( | ) |
Returns the ID of the oldest revision that was reverted by this edit.
The same as getOldestRevertedRevisionId if only a single revision was reverted. Returns null if the edit was not a revert.
Definition at line 123 of file EditResult.php.
MediaWiki\Storage\EditResult::getOriginalRevisionId | ( | ) |
Returns the ID of an earlier revision that is being repeated or restored.
The original revision's content should match the new revision exactly.
Definition at line 151 of file EditResult.php.
MediaWiki\Storage\EditResult::getRevertMethod | ( | ) |
Returns the revert method that was used to perform the edit, if any changes were reverted.
Returns null if the edit was not a revert.
Possible values: REVERT_UNDO, REVERT_ROLLBACK, REVERT_MANUAL
Definition at line 194 of file EditResult.php.
MediaWiki\Storage\EditResult::getRevertTags | ( | ) |
Returns an array of revert-related tags that were applied automatically to this edit.
Definition at line 223 of file EditResult.php.
MediaWiki\Storage\EditResult::getUndidRevId | ( | ) |
If the edit was an undo, returns the oldest revision that was undone.
Method kept for compatibility reasons.
Definition at line 133 of file EditResult.php.
MediaWiki\Storage\EditResult::isExactRevert | ( | ) |
Whether the edit was an exact revert, i.e.
the contents of the revert revision and restored revision match
Definition at line 204 of file EditResult.php.
Referenced by MediaWiki\Storage\EditResult\__construct().
MediaWiki\Storage\EditResult::isNew | ( | ) |
Whether the edit created a new page.
Definition at line 160 of file EditResult.php.
Referenced by MediaWiki\Storage\EditResult\__construct().
MediaWiki\Storage\EditResult::isNullEdit | ( | ) |
An edit is a null edit if the original revision is equal to the parent revision, i.e.
no changes were made.
Definition at line 214 of file EditResult.php.
Referenced by MediaWiki\Storage\EditResult\__construct().
MediaWiki\Storage\EditResult::isRevert | ( | ) |
Whether the edit was a revert, not necessarily exact.
An edit is considered a revert if it either:
To check whether the edit was an exact revert, please use the isExactRevert() method. The getRevertMethod() will provide additional information about which kind of revert was made.
Definition at line 180 of file EditResult.php.
|
private |
Definition at line 59 of file EditResult.php.
Referenced by MediaWiki\Storage\EditResult\__construct().
|
private |
Definition at line 44 of file EditResult.php.
Referenced by MediaWiki\Storage\EditResult\__construct().
|
private |
Definition at line 62 of file EditResult.php.
Referenced by MediaWiki\Storage\EditResult\__construct().
|
private |
Definition at line 53 of file EditResult.php.
|
private |
Definition at line 56 of file EditResult.php.
|
private |
Definition at line 47 of file EditResult.php.
Referenced by MediaWiki\Storage\EditResult\__construct().
|
private |
Definition at line 50 of file EditResult.php.
Referenced by MediaWiki\Storage\EditResult\__construct().
|
private |
Definition at line 65 of file EditResult.php.
Referenced by MediaWiki\Storage\EditResult\__construct().
const MediaWiki\Storage\EditResult::REVERT_MANUAL = 3 |
Definition at line 41 of file EditResult.php.
const MediaWiki\Storage\EditResult::REVERT_ROLLBACK = 2 |
Definition at line 40 of file EditResult.php.
const MediaWiki\Storage\EditResult::REVERT_UNDO = 1 |
Definition at line 39 of file EditResult.php.