Adding 'last' validator option fix for Model::invalidFields()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6240 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-12-24 22:14:31 +00:00
parent 44718cced7
commit 586e93f59f

View file

@ -1904,6 +1904,9 @@ class Model extends Overloadable {
if (empty($validator['on']) || ($validator['on'] == 'create' && !$exists) || ($validator['on'] == 'update' && $exists)) {
if ((!isset($data[$fieldName]) && $validator['required'] === true) || (isset($data[$fieldName]) && (empty($data[$fieldName]) && !is_numeric($data[$fieldName])) && $validator['allowEmpty'] === false)) {
$this->invalidate($fieldName, $message);
if ($validator['last']) {
break;
}
} elseif (array_key_exists($fieldName, $data)) {
if (empty($data[$fieldName]) && $data[$fieldName] != '0' && $validator['allowEmpty'] === true) {
break;