diff --git a/src/validator/AgaviAndoperatorValidator.class.php b/src/validator/AgaviAndoperatorValidator.class.php index bc5c16d17..e3631888b 100644 --- a/src/validator/AgaviAndoperatorValidator.class.php +++ b/src/validator/AgaviAndoperatorValidator.class.php @@ -19,6 +19,7 @@ * Parameters: * 'skip_errors' do not submit errors of child validators to validator manager * 'break' break the execution of child validators after first failure + * 'min_fail_severity' minimum child validator severity level to fail on * * @package agavi * @subpackage validator @@ -47,10 +48,15 @@ protected function validate() { $return = true; + $min_fail_severity = $this->getParameter('min_fail_severity', AgaviValidator::INFO); + if(strpos($min_fail_severity, '::') && defined($min_fail_severity)) { + $min_fail_severity = constant($min_fail_severity); + } + foreach($this->children as $child) { $result = $child->execute($this->validationParameters); $this->result = max($result, $this->result); - if($result > AgaviValidator::SUCCESS) { + if($result >= $min_fail_severity) { // if one validator fails, the whole operator fails $return = false; $this->throwError(); @@ -64,4 +70,4 @@ protected function validate() } } -?> \ No newline at end of file +?>