MediaWiki master
MediaWiki\Storage\PageUpdateStatus Class Reference

Status object representing the outcome of a page update. More...

Inherits MediaWiki\Status\Status.

Collaboration diagram for MediaWiki\Storage\PageUpdateStatus:

Public Member Functions

 failedBecauseOfConflict ()
 Whether the update failed because a conflicting update happened concurrently.
 
 failedBecausePageExists ()
 Whether the update failed because page creation was required, but the page already exists.
 
 failedBecausePageMissing ()
 Whether the update failed because page modification was required, but the page does not exist.
 
 getNewRevision ()
 The revision created by PageUpdater::saveRevision().
 
 setNewRevision (RevisionRecord $rev)
 
 wasPageCreated ()
 Whether the update created the page.
 
 wasRevisionCreated ()
 Whether the update created a revision.
 
- Public Member Functions inherited from MediaWiki\Status\Status
 __get ( $name)
 Backwards compatibility logic.
 
 __set ( $name, $value)
 Change operation result Backwards compatibility logic.
 
 __sleep ()
 Don't save the callback when serializing, because Closures can't be serialized and we're going to clear it in __wakeup anyway.
 
 __wakeup ()
 Sanitize the callback parameter on wakeup, to avoid arbitrary execution.
 
 getErrorsArray ()
 Get the list of errors (but not warnings)
 
 getHTML ( $shortContext=false, $longContext=false, $lang=null)
 Get the error message as HTML.
 
 getMessage ( $shortContext=false, $longContext=false, $lang=null)
 Get a bullet list of the errors as a Message object.
 
 getPsr3MessageAndContext ()
 Try to convert the status to a PSR-3 friendly format.
 
 getStatusValue ()
 Returns the wrapped StatusValue object.
 
 getWarningsArray ()
 Get the list of warnings (but not errors)
 
 getWikiText ( $shortContext=false, $longContext=false, $lang=null)
 Get the error list as a wikitext formatted list.
 
 setMessageLocalizer (MessageLocalizer $messageLocalizer)
 Makes this Status object use the given localizer instead of the global one.
 
 splitByErrorType ()
 Splits this Status object into two new Status objects, one which contains only the error messages, and one that contains the warnings, only.
 
- Public Member Functions inherited from StatusValue
 __toString ()
 Returns a string representation of the status for debugging.
 
 error ( $message,... $parameters)
 Add an error, do not set fatal flag This can be used for non-fatal errors.
 
 fatal ( $message,... $parameters)
 Add an error and set OK to false, indicating that the operation as a whole was fatal.
 
 getErrors ()
 Get the list of errors.
 
 getErrorsByType ( $type)
 Returns a list of status messages of the given type.
 
 getValue ()
 
 hasMessage ( $message)
 Returns true if the specified message is present as a warning or error.
 
 hasMessagesExcept (... $messages)
 Returns true if any other message than the specified ones is present as a warning or error.
 
 isGood ()
 Returns whether the operation completed and didn't have any error or warnings.
 
 isOK ()
 Returns whether the operation completed.
 
 merge ( $other, $overwriteValue=false)
 Merge another status object into this one.
 
 replaceMessage ( $source, $dest)
 If the specified source message exists, replace it with the specified destination message, but keep the same parameters as in the original error.
 
 setOK ( $ok)
 Change operation status.
 
 setResult ( $ok, $value=null)
 Change operation result.
 
 warning ( $message,... $parameters)
 Add a new warning.
 

Static Public Member Functions

static newEmpty (bool $newPage)
 
- Static Public Member Functions inherited from MediaWiki\Status\Status
static wrap ( $sv)
 Succinct helper method to wrap a StatusValue.
 
- Static Public Member Functions inherited from StatusValue
static newFatal ( $message,... $parameters)
 Factory function for fatal errors.
 
static newGood ( $value=null)
 Factory function for good results.
 

Additional Inherited Members

- Public Attributes inherited from MediaWiki\Status\Status
callable false $cleanCallback = false
 
- Public Attributes inherited from StatusValue
int $failCount = 0
 Counter for batch operations.
 
mixed $statusData
 arbitrary extra data about the operation
 
bool[] $success = []
 Map of (key => bool) to indicate success of each part of batch operations.
 
int $successCount = 0
 Counter for batch operations.
 
mixed $value
 
- Protected Member Functions inherited from StatusValue
 getStatusArray ( $type=false)
 Returns a list of status messages of the given type (or all if false)
 
- Protected Attributes inherited from MediaWiki\Status\Status
MessageLocalizer null $messageLocalizer
 
- Protected Attributes inherited from StatusValue
array[] $errors = []
 
bool $ok = true
 

Detailed Description

Status object representing the outcome of a page update.

See also
PageUpdater
Since
1.40
Author
Daniel Kinzler

Definition at line 35 of file PageUpdateStatus.php.

Member Function Documentation

◆ failedBecauseOfConflict()

MediaWiki\Storage\PageUpdateStatus::failedBecauseOfConflict ( )

Whether the update failed because a conflicting update happened concurrently.

Returns
bool

Definition at line 117 of file PageUpdateStatus.php.

◆ failedBecausePageExists()

MediaWiki\Storage\PageUpdateStatus::failedBecausePageExists ( )

Whether the update failed because page creation was required, but the page already exists.

Returns
bool

Definition at line 101 of file PageUpdateStatus.php.

◆ failedBecausePageMissing()

MediaWiki\Storage\PageUpdateStatus::failedBecausePageMissing ( )

Whether the update failed because page modification was required, but the page does not exist.

Returns
bool

Definition at line 109 of file PageUpdateStatus.php.

◆ getNewRevision()

MediaWiki\Storage\PageUpdateStatus::getNewRevision ( )

The revision created by PageUpdater::saveRevision().

Will return null if no revision was created because there was an error, or because the content didn't change (null edit or derived slot update).

Call isOK() to distinguish these cases.

Returns
?RevisionRecord

Definition at line 68 of file PageUpdateStatus.php.

◆ newEmpty()

static MediaWiki\Storage\PageUpdateStatus::newEmpty ( bool  $newPage)
static
Access: internal
for use by PageUpdater only
Parameters
bool$newPage
Returns
PageUpdateStatus

Definition at line 43 of file PageUpdateStatus.php.

◆ setNewRevision()

MediaWiki\Storage\PageUpdateStatus::setNewRevision ( RevisionRecord  $rev)
Access: internal
for use by PageUpdater only
Parameters
RevisionRecord$rev

Definition at line 54 of file PageUpdateStatus.php.

◆ wasPageCreated()

MediaWiki\Storage\PageUpdateStatus::wasPageCreated ( )

Whether the update created the page.

Returns
bool

Definition at line 92 of file PageUpdateStatus.php.

◆ wasRevisionCreated()

MediaWiki\Storage\PageUpdateStatus::wasRevisionCreated ( )

Whether the update created a revision.

If this returns false even though isOK() returns true, this means that no new revision was created because the content didn't change, including updates to derived slots.

Returns
bool

Definition at line 84 of file PageUpdateStatus.php.


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