Sync: use a single db transaction

This commit is contained in:
Thomas Gelf 2015-07-24 15:29:17 +02:00
parent 1c5f83a6cf
commit 7edc5f37b3
1 changed files with 4 additions and 0 deletions

View File

@ -127,6 +127,8 @@ class Sync
}
}
$dba = $db->getDbAdapter();
$dba->beginTransaction();
foreach ($objects as $object) {
if ($object->hasBeenLoadedFromDb() && $rule->purge_existing === 'y') {
/*
@ -138,6 +140,8 @@ class Sync
}
$object->store($db);
}
$dba->commit();
}
}
}