浏览代码

added addConstraint() to ErrorElement closes #1200

Sebastiaan Stok 12 年之前
父节点
当前提交
01414630e1
共有 1 个文件被更改,包括 12 次插入0 次删除
  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