Explorar el Código

added addConstraint() to ErrorElement closes #1200

Sebastiaan Stok hace 12 años
padre
commit
01414630e1
Se han modificado 1 ficheros con 12 adiciones y 0 borrados
  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