]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/form/ActionErrors.class.php
Introduced shorter functions for Errors class
[timetracker.git] / WEB-INF / lib / form / ActionErrors.class.php
index 04a6333f0db677277616b1b29e8c7b7f8529feec..0206136146ea9751a01eaa8438af99c5a57586b5 100644 (file)
 
 class ActionErrors {
     var $errors = array();
-    
+
     function ActionErrors() {
     }
-    
+
     function isEmpty() {
-        return (count($this->errors)>0 ? false : true );
+        return (count($this->errors)>0 ? false : true);
     }
-    
+
+    function exist() {
+        return (count($this->errors)>0 ? true : false);
+    }
+
+    function no() {
+        return (count($this->errors)>0 ? false : true);
+    }
+
+    function yes() {
+        return (count($this->errors)>0 ? true : false);
+    }
+
     function add($message, $arg0 = '', $arg1 = '') {
        $patterns = array ("/\{0\}/","/\{1\}/");
                $replace = array ($arg0, $arg1);
@@ -43,14 +55,6 @@ class ActionErrors {
         $this->errors[]["message"] = $message;
     }    
     
-    function addAll($arr) {
-       if (is_array($arr)) {
-               foreach ($arr as $k=>$v) {
-                       $this->errors[$k] = $v;
-               }
-       }
-    }
-    
     function get($key) {
         return $this->errors["$key"]["message"];
     }