+ /**
+ * Converts a Status object to an array suitable for addValue
+ * @param Status $status
+ * @param string $errorType
+ * @return array
+ */
+ public function convertStatusToArray( $status, $errorType = 'error' ) {
+ if ( $status->isGood() ) {
+ return array();
+ }
+
+ $result = array();
+ foreach ( $status->getErrorsByType( $errorType ) as $error ) {
+ $this->setIndexedTagName( $error['params'], 'param' );
+ $result[] = $error;
+ }
+ $this->setIndexedTagName( $result, $errorType );
+ return $result;
+ }
+