MediaWiki REL1_39
ApiRawMessage.php
Go to the documentation of this file.
1<?php
27class ApiRawMessage extends RawMessage implements IApiMessage {
29
39 public function __construct( $msg, $code = null, array $data = null ) {
40 if ( $msg instanceof RawMessage ) {
41 foreach ( get_class_vars( get_class( $this ) ) as $key => $value ) {
42 if ( isset( $msg->$key ) ) {
43 $this->$key = $msg->$key;
44 }
45 }
46 } elseif ( is_array( $msg ) ) {
47 $key = array_shift( $msg );
48 parent::__construct( $key, $msg );
49 } else {
50 parent::__construct( $msg );
51 }
52 $this->setApiCode( $code, $data );
53 }
54}
Extension of RawMessage implementing IApiMessage.
__construct( $msg, $code=null, array $data=null)
string $key
The message key.
Definition Message.php:182
Variant of the Message class.
trait ApiMessageTrait
Trait to implement the IApiMessage interface for Message subclasses.
Interface for messages with machine-readable data for use by the API.
setApiCode( $code, array $data=null)
Sets the machine-readable code for use by the API.