37 public function __construct( $msg, $code =
null, array $data =
null ) {
39 foreach ( get_class_vars( get_class( $this ) ) as
$key => $value ) {
40 if ( isset( $msg->$key ) ) {
41 $this->
$key = $msg->$key;
44 } elseif ( is_array( $msg ) ) {
45 $key = array_shift( $msg );
46 parent::__construct(
$key, $msg );
48 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.