* @return Message
*/
protected function getMessage( $value ) {
- if ( $value instanceof Message ) {
- return $value;
- } elseif ( $value instanceof MessageSpecifier ) {
- return Message::newFromKey( $value );
- } elseif ( is_array( $value ) ) {
- $msg = array_shift( $value );
- return $this->msg( $msg, $value );
- } else {
- return $this->msg( $value, [] );
- }
+ return Message::newFromSpecifier( $value )->setContext( $this->mParent );
}
+
+ /**
+ * Skip this field when collecting data.
+ * @param WebRequest $request
+ * @return bool
+ * @since 1.27
+ */
+ public function skipLoadData( $request ) {
+ return !empty( $this->mParams['nodata'] );
+ }
}