Further transaction log improvements

This commit is contained in:
Pinga 2023-08-25 12:33:48 +03:00
parent 9c97f3077a
commit 266a3386ac
2 changed files with 74 additions and 13 deletions

View file

@ -257,4 +257,14 @@ function updateTransaction($db, $cmd, $obj_type, $obj_id, $code, $msg, $svTRID,
}
return true;
}
function getClid(PDO $db, string $clid): ?int {
$stmt = $db->prepare("SELECT id FROM registrar WHERE clid = :clid LIMIT 1");
$stmt->bindParam(':clid', $clid, PDO::PARAM_STR);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
return $result ? (int)$result['id'] : null;
}