Allowing behavior methods to be used in model validation (Ticket #3178)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5651 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-09-16 18:18:23 +00:00
parent 8237bf51e3
commit 1791a378c0

View file

@ -1723,7 +1723,7 @@ class Model extends Overloadable {
$valid = true;
$msg = null;
if (method_exists($this, $rule)) {
if (method_exists($this, $rule) || isset($this->__behaviorMethods[$rule]) || isset($this->__behaviorMethods[low($rule)])) {
$ruleParams[] = array_diff_key($validator, $default);
$valid = call_user_func_array(array(&$this, $rule), $ruleParams);
} elseif (method_exists($Validation, $rule)) {