Being able to get the message key and parameters from a Message object
is needed to be able to report errors from the API in an abstract,
language neutral way.
Change-Id: I8ee9da4005db7cb0a487457127f1e24fb11dbd66
$this->language = $wgLang;
}
+ /**
+ * Returns the message key
+ *
+ * @since 1.21
+ *
+ * @return string
+ */
+ public function getKey() {
+ return $this->key;
+ }
+
+ /**
+ * Returns the message parameters
+ *
+ * @since 1.21
+ *
+ * @return string[]
+ */
+ public function getParams() {
+ return $this->parameters;
+ }
+
+ /**
+ * Returns the message format
+ *
+ * @since 1.21
+ *
+ * @return string
+ */
+ public function getFormat() {
+ return $this->format;
+ }
+
/**
* Factory function that is just wrapper for the real constructor. It is
* intented to be used instead of the real constructor, because it allows
/**
* Get the error message as HTML. This is done by parsing the wikitext error
* message.
+ *
+ * @note: this does not perform a full wikitext to HTML conversion, it merely applies
+ * a message transformation.
+ * @todo: figure out whether that is actually The Right Thing.
*/
public function getHTML( $shortContext = false, $longContext = false ) {
$text = $this->getWikiText( $shortContext, $longContext );