TranslateBehavior now uses original atomic option value, if set

This commit is contained in:
Ceeram 2014-10-10 14:17:16 +02:00
parent 7b44d5d7a3
commit 1dfd3405a4

View file

@ -437,6 +437,10 @@ class TranslateBehavior extends ModelBehavior {
$tempData = $this->_prepareTranslations($Model, $tempData); $tempData = $this->_prepareTranslations($Model, $tempData);
} }
$locale = $this->_getLocale($Model); $locale = $this->_getLocale($Model);
$atomic = array();
if (isset($options['atomic'])) {
$atomic = array('atomic' => $options['atomic']);
}
foreach ($tempData as $field => $value) { foreach ($tempData as $field => $value) {
unset($conditions['content']); unset($conditions['content']);
@ -466,10 +470,11 @@ class TranslateBehavior extends ModelBehavior {
$RuntimeModel->save(array( $RuntimeModel->save(array(
$RuntimeModel->alias => array_merge( $RuntimeModel->alias => array_merge(
$conditions, array('id' => $translations[$_locale]) $conditions, array('id' => $translations[$_locale])
) ),
$atomic
)); ));
} else { } else {
$RuntimeModel->save(array($RuntimeModel->alias => $conditions)); $RuntimeModel->save(array($RuntimeModel->alias => $conditions), $atomic);
} }
} }
} }