浏览代码

[2.1 BC fix] Upgraded to latest changes in ConstraintValidatorInterface
;

Robert Gruendler 13 年之前
父节点
当前提交
61253cdf77
共有 1 个文件被更改,包括 2 次插入6 次删除
  1. 2 6
      Validator/ErrorElement.php

+ 2 - 6
Validator/ErrorElement.php

@@ -115,14 +115,10 @@ class ErrorElement
         $validator  = $this->constraintValidatorFactory->getInstance($constraint);
         $value      = $this->getValue();
 
-        $validator->isValid($value, $constraint);
-
-        $this->context->setPropertyPath($this->getFullPropertyPath());
-        $this->context->setGroup($this->group);
-
         $validator->initialize($this->context);
+        $validator->validate($value, $constraint);
 
-        if (!$validator->isValid($value, $constraint)) {
+        if (count($this->context->getViolations())) {
             $this->context->addViolation(
                 $messageTemplate ?: $validator->getMessageTemplate(),
                 array_merge($validator->getMessageParameters(), $messageParameters),