mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
TranslateBehavior now uses original atomic option value, if set
This commit is contained in:
parent
7b44d5d7a3
commit
1dfd3405a4
1 changed files with 7 additions and 2 deletions
|
@ -437,6 +437,10 @@ class TranslateBehavior extends ModelBehavior {
|
|||
$tempData = $this->_prepareTranslations($Model, $tempData);
|
||||
}
|
||||
$locale = $this->_getLocale($Model);
|
||||
$atomic = array();
|
||||
if (isset($options['atomic'])) {
|
||||
$atomic = array('atomic' => $options['atomic']);
|
||||
}
|
||||
|
||||
foreach ($tempData as $field => $value) {
|
||||
unset($conditions['content']);
|
||||
|
@ -466,10 +470,11 @@ class TranslateBehavior extends ModelBehavior {
|
|||
$RuntimeModel->save(array(
|
||||
$RuntimeModel->alias => array_merge(
|
||||
$conditions, array('id' => $translations[$_locale])
|
||||
)
|
||||
),
|
||||
$atomic
|
||||
));
|
||||
} else {
|
||||
$RuntimeModel->save(array($RuntimeModel->alias => $conditions));
|
||||
$RuntimeModel->save(array($RuntimeModel->alias => $conditions), $atomic);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue