Browse Source

added addConstraint() to ErrorElement closes #1200

Sebastiaan Stok 12 years ago
parent
commit
01414630e1
1 changed files with 12 additions and 0 deletions
  1. 12 0
      Validator/ErrorElement.php

+ 12 - 0
Validator/ErrorElement.php

@@ -71,6 +71,18 @@ class ErrorElement
         return $this;
     }
 
+    /**
+     * @param Constraint $constraint
+     *
+     * @return ErrorElement
+     */
+    public function addConstraint(Constraint $constraint)
+    {
+        $this->validate($constraint);
+
+        return $this;
+    }
+
     /**
      * @param string $name
      * @param bool   $key