mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-07 03:52:41 +00:00
Making saveAll() behave like plain save() when suplied empty data array, closes #277
This commit is contained in:
parent
8375570f8a
commit
5c186d4430
2 changed files with 23 additions and 0 deletions
|
@ -1584,6 +1584,11 @@ class Model extends Overloadable {
|
|||
$validates = true;
|
||||
$return = array();
|
||||
|
||||
if (empty($data) && $options['validate'] !== false) {
|
||||
$result = $this->save($data, $options);
|
||||
return !empty($result);
|
||||
}
|
||||
|
||||
if ($options['atomic'] && $options['validate'] !== 'only') {
|
||||
$db->begin($this);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue