MediaWiki master
ApiMessage Class Reference

Extension of Message implementing IApiMessage. More...

Inherits Message, and IApiMessage.

Collaboration diagram for ApiMessage:

Public Member Functions

 __construct ( $msg, $code=null, array $data=null)
 
- Public Member Functions inherited from IApiMessage
 getApiCode ()
 Returns a machine-readable code for use by the API.
 
 getApiData ()
 Returns additional machine-readable data about the error condition.
 
 setApiCode ( $code, array $data=null)
 Sets the machine-readable code for use by the API.
 
 setApiData (array $data)
 Sets additional machine-readable data about the error condition.
 
- Public Member Functions inherited from MessageSpecifier
 getKey ()
 Returns the message key.
 
 getParams ()
 Returns the message parameters.
 

Static Public Member Functions

static create ( $msg, $code=null, array $data=null)
 Create an IApiMessage for the message.
 

Detailed Description

Extension of Message implementing IApiMessage.

Stability: newable
Since
1.25

Definition at line 29 of file ApiMessage.php.

Constructor & Destructor Documentation

◆ __construct()

ApiMessage::__construct ( $msg,
$code = null,
array $data = null )
Parameters
MessageSpecifier | string | array$msg
  • Message: is cloned
  • array: first element is $key, rest are $params to Message::__construct
  • string, any other MessageSpecifier: passed to Message::__construct
string | null$code
array | null$data

Definition at line 75 of file ApiMessage.php.

References setApiCode().

Member Function Documentation

◆ create()

static ApiMessage::create ( $msg,
$code = null,
array $data = null )
static

Create an IApiMessage for the message.

This returns $msg if it's an IApiMessage, calls 'new ApiRawMessage' if $msg is a RawMessage, or calls 'new ApiMessage' in all other cases.

Stability: stable
to call
Parameters
MessageSpecifier | array | string$msg
string | null$code
array | null$data
Returns
IApiMessage

Definition at line 45 of file ApiMessage.php.


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