MediaWiki REL1_28
ApiErrorFormatter_BackCompat Class Reference

Format errors and warnings in the old style, for backwards compatibility. More...

Inheritance diagram for ApiErrorFormatter_BackCompat:
Collaboration diagram for ApiErrorFormatter_BackCompat:

Public Member Functions

 __construct (ApiResult $result)
 
 arrayFromStatus (Status $status, $type='error', $format=null)
 Format messages from a Status as an array.
 
- Public Member Functions inherited from ApiErrorFormatter
 __construct (ApiResult $result, Language $lang, $format, $useDB=false)
 
 addError ( $moduleName, $msg, $code=null, $data=null)
 Add an error to the result.
 
 addMessagesFromStatus ( $moduleName, Status $status, $types=[ 'warning', 'error'])
 Add warnings and errors from a Status object to the result.
 
 addWarning ( $moduleName, $msg, $code=null, $data=null)
 Add a warning to the result.
 

Protected Member Functions

 addWarningOrError ( $tag, $moduleName, $msg)
 Actually add the warning or error to the result.
 
- Protected Member Functions inherited from ApiErrorFormatter
 getDummyTitle ()
 Fetch a dummy title to set on Messages.
 

Additional Inherited Members

- Protected Attributes inherited from ApiErrorFormatter
 $format = 'none'
 
Language $lang
 
ApiResult $result
 
 $useDB = false
 

Detailed Description

Format errors and warnings in the old style, for backwards compatibility.

Since
1.25
Deprecated:
Only for backwards compatibility, do not use

Definition at line 236 of file ApiErrorFormatter.php.

Constructor & Destructor Documentation

◆ __construct()

ApiErrorFormatter_BackCompat::__construct ( ApiResult  $result)
Parameters
ApiResult$resultInto which data will be added

Definition at line 242 of file ApiErrorFormatter.php.

Member Function Documentation

◆ addWarningOrError()

ApiErrorFormatter_BackCompat::addWarningOrError (   $tag,
  $moduleName,
  $msg 
)
protected

Actually add the warning or error to the result.

Parameters
string$tag'warning' or 'error'
string$moduleName
ApiMessage | ApiRawMessage$msg

Reimplemented from ApiErrorFormatter.

Definition at line 267 of file ApiErrorFormatter.php.

References $code, ApiBase\$messageMap, $path, $tag, $value, ApiResult\ADD_ON_TOP, ApiResult\NO_SIZE_CHECK, and ApiResult\OVERRIDE.

◆ arrayFromStatus()

ApiErrorFormatter_BackCompat::arrayFromStatus ( Status  $status,
  $type = 'error',
  $format = null 
)

Format messages from a Status as an array.

Parameters
Status$status
string$type'warning' or 'error'
string | null$format
Returns
array

Reimplemented from ApiErrorFormatter.

Definition at line 246 of file ApiErrorFormatter.php.

References ApiErrorFormatter\$result, $status, $type, as, and ApiResult\setIndexedTagName().


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