mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
fix up the fails
This commit is contained in:
parent
24abed969a
commit
03882f4b55
1 changed files with 3 additions and 5 deletions
|
@ -155,10 +155,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
|||
$data[$association] = $model->{$association}->data[$model->{$association}->alias];
|
||||
}
|
||||
if (is_array($validates)) {
|
||||
$validates = true;
|
||||
if (in_array(false, Hash::flatten($validates), true)) {
|
||||
$validates = false;
|
||||
}
|
||||
$validates = !in_array(false, Hash::flatten($validates), true);
|
||||
}
|
||||
$return[$association] = $validates;
|
||||
} elseif ($associations[$association] === 'hasMany') {
|
||||
|
@ -217,10 +214,11 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
|||
$validates = $model->set($record) && $model->validates($options);
|
||||
$data[$key] = $model->data;
|
||||
}
|
||||
$validates = true;
|
||||
if ($validates === false || (is_array($validates) && in_array(false, Hash::flatten($validates), true))) {
|
||||
$validationErrors[$key] = $model->validationErrors;
|
||||
$validates = false;
|
||||
} else {
|
||||
$validates = true;
|
||||
}
|
||||
$return[$key] = $validates;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue