39 public function __construct( $msg, $code =
null, array $data =
null ) {
41 foreach ( get_class_vars( get_class( $this ) ) as
$key => $value ) {
42 if ( isset( $msg->$key ) ) {
43 $this->
$key = $msg->$key;
46 } elseif ( is_array( $msg ) ) {
47 $key = array_shift( $msg );
48 parent::__construct(
$key, $msg );
50 parent::__construct( $msg );
Extension of RawMessage implementing IApiMessage.
__construct( $msg, $code=null, array $data=null)
string $key
The message key.
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.