ADded transactions for multiple get handlers
This commit is contained in:
parent
25382d0de3
commit
dcc0989d6d
4 changed files with 16 additions and 0 deletions
|
@ -37,6 +37,8 @@ class Credentials
|
|||
*/
|
||||
public function getCredentials(\Utils\PagingInfo &$pi, int $recordId) : array
|
||||
{
|
||||
$this->db->beginTransaction();
|
||||
|
||||
//Count elements
|
||||
if ($pi->pageSize === null) {
|
||||
$pi->totalPages = 1;
|
||||
|
@ -62,6 +64,8 @@ class Credentials
|
|||
|
||||
$data = $query->fetchAll();
|
||||
|
||||
$this->db->commit();
|
||||
|
||||
return array_map(function ($item) {
|
||||
$item['id'] = intval($item['id']);
|
||||
return $item;
|
||||
|
|
|
@ -38,6 +38,8 @@ class Domains
|
|||
*/
|
||||
public function getDomains(\Utils\PagingInfo &$pi, int $userId, ? string $query, ? string $sorting, ? string $type) : array
|
||||
{
|
||||
$this->db->beginTransaction();
|
||||
|
||||
$ac = new \Operations\AccessControl($this->c);
|
||||
$userIsAdmin = $ac->isAdmin($userId);
|
||||
|
||||
|
@ -99,6 +101,8 @@ class Domains
|
|||
|
||||
$data = $query->fetchAll();
|
||||
|
||||
$this->db->commit();
|
||||
|
||||
return array_map(function ($item) {
|
||||
if ($item['type'] != 'SLAVE') {
|
||||
unset($item['master']);
|
||||
|
|
|
@ -35,6 +35,8 @@ class Permissions
|
|||
*/
|
||||
public function getPermissions(\Utils\PagingInfo &$pi, int $userId) : array
|
||||
{
|
||||
$this->db->beginTransaction();
|
||||
|
||||
//Count elements
|
||||
if ($pi->pageSize === null) {
|
||||
$pi->totalPages = 1;
|
||||
|
@ -63,6 +65,8 @@ class Permissions
|
|||
|
||||
$data = $query->fetchAll();
|
||||
|
||||
$this->db->commit();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,8 @@ class Records
|
|||
? string $queryContent,
|
||||
? string $sort
|
||||
) : array {
|
||||
$this->db->beginTransaction();
|
||||
|
||||
$ac = new \Operations\AccessControl($this->c);
|
||||
$userIsAdmin = $ac->isAdmin($userId);
|
||||
|
||||
|
@ -119,6 +121,8 @@ class Records
|
|||
|
||||
$data = $query->fetchAll();
|
||||
|
||||
$this->db->commit();
|
||||
|
||||
return array_map(function ($item) {
|
||||
$item['id'] = intval($item['id']);
|
||||
$item['priority'] = intval($item['priority']);
|
||||
|
|
Loading…
Reference in a new issue