remove unnecessary startTransaction and commit calls
This commit is contained in:
3 files changed
-32
No files matched your search
@@ -104,8 +104,6 @@ class MapAdminController implements IAuthenticationRequired, ISecured
|
||||
{
|
||||
$mapId = (int) $this->request->query('mapId');
|
||||
|
||||
\Container::$dbConnection->startTransaction();
|
||||
|
||||
if ($mapId) {
|
||||
$map = $this->mapRepository->getById($mapId);
|
||||
} else {
|
||||
@@ -186,8 +184,6 @@ class MapAdminController implements IAuthenticationRequired, ISecured
|
||||
|
||||
$this->pdm->saveToDb($map);
|
||||
|
||||
\Container::$dbConnection->commit();
|
||||
|
||||
return new JsonContent(['mapId' => $map->getId(), 'added' => $addedIds]);
|
||||
}
|
||||
|
||||
@@ -197,14 +193,10 @@ class MapAdminController implements IAuthenticationRequired, ISecured
|
||||
|
||||
$map = $this->mapRepository->getById($mapId);
|
||||
|
||||
\Container::$dbConnection->startTransaction();
|
||||
|
||||
$this->deletePlaces($map);
|
||||
|
||||
$this->pdm->deleteFromDb($map);
|
||||
|
||||
\Container::$dbConnection->commit();
|
||||
|
||||
return new JsonContent(['success' => true]);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user