41 public function __construct( $msg, $code =
null, array $data =
null ) {
43 foreach ( get_class_vars( get_class( $this ) ) as
$key => $value ) {
44 if ( isset( $msg->$key ) ) {
45 $this->
$key = $msg->$key;
48 } elseif ( is_array( $msg ) ) {
49 $key = array_shift( $msg );
50 parent::__construct(
$key, $msg );
52 parent::__construct( $msg );
58 if ( $this->apiCode ===
null ) {
Extension of RawMessage implementing IApiMessage.
__construct( $msg, $code=null, array $data=null)
getApiCode()
Returns a machine-readable code for use by the API.
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.