mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
add transactions to student.php
This commit is contained in:
@@ -345,6 +345,10 @@ class Student extends FHCAPI_Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do Updates
|
// Do Updates
|
||||||
|
|
||||||
|
// use transactions
|
||||||
|
$this->db->trans_begin();
|
||||||
|
|
||||||
if (count($update_lehrverband)) {
|
if (count($update_lehrverband)) {
|
||||||
|
|
||||||
$curstudlvb = $this->StudentlehrverbandModel->load([
|
$curstudlvb = $this->StudentlehrverbandModel->load([
|
||||||
@@ -436,6 +440,18 @@ class Student extends FHCAPI_Controller
|
|||||||
$this->getDataOrTerminateWithError($result);
|
$this->getDataOrTerminateWithError($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->db->trans_status() === FALSE)
|
||||||
|
{
|
||||||
|
$this->db->trans_rollback();
|
||||||
|
|
||||||
|
$this->terminateWithError(
|
||||||
|
$this->p->t('ui', 'error_save'),
|
||||||
|
self::ERROR_TYPE_GENERAL
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->trans_commit();
|
||||||
|
|
||||||
$this->terminateWithSuccess(array_fill_keys(array_merge(
|
$this->terminateWithSuccess(array_fill_keys(array_merge(
|
||||||
array_keys($update_lehrverband),
|
array_keys($update_lehrverband),
|
||||||
array_keys($update_person),
|
array_keys($update_person),
|
||||||
|
|||||||
Reference in New Issue
Block a user