Display permissions specific to the API (such as writeapi and apihighlimits) on actio...
[lhc/web/wiklou.git] / includes / Status.php
index 98602cf..185ea6e 100644 (file)
@@ -170,4 +170,25 @@ class Status {
                $this->successCount += $other->successCount;
                $this->failCount += $other->failCount;
        }
+       
+       function getErrorsArray() {
+               $result = array();
+               foreach ( $this->errors as $error ) {
+                       if ( $error['type'] == 'error' )
+                               $result[] = $error['message'];
+               }
+               return $result;
+       }
+
+       /**
+        * Returns true if the specified message is present as a warning or error
+        */
+       function hasMessage( $msg ) {
+               foreach ( $this->errors as $error ) {
+                       if ( $error['message'] === $msg ) {
+                               return true;
+                       }
+               }
+               return false;
+       }
 }