More RST changes

This commit is contained in:
Pinga 2025-04-28 19:12:06 +03:00
parent 3e1c12df33
commit 989f3d4f33
2 changed files with 137 additions and 123 deletions

View file

@ -534,4 +534,14 @@ function getClid(PDO $db, int $registrar_id): ?string {
$result = $stmt->fetch(PDO::FETCH_ASSOC);
return $result ? (string)$result['clid'] : null;
}
function getIdentifier(PDO $db, int $contact_id): ?string {
$stmt = $db->prepare("SELECT identifier FROM contact WHERE id = :id LIMIT 1");
$stmt->bindParam(':id', $contact_id, PDO::PARAM_INT);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
return $result ? (string)$result['identifier'] : null;
}