Allow updating and getting names of vocabulary groups
This commit is contained in:
parent
a677c605c5
commit
50cb33720b
|
@ -30,6 +30,7 @@ final class NodaLogEdit {
|
|||
'synchronize',
|
||||
'status',
|
||||
'translation',
|
||||
'group',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -335,4 +335,28 @@ final class NodaNameGetter {
|
|||
return "";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function for getting the name for a group.
|
||||
*
|
||||
* @param MDMysqli $mysqli_noda DB connection.
|
||||
* @param integer $group_id Group ID.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getGroupName(MDMysqli $mysqli_noda, int $group_id):string {
|
||||
|
||||
$result = $mysqli_noda->query_by_stmt("SELECT `group_name`
|
||||
FROM `group`
|
||||
WHERE `group_id` = ?", "i", $group_id);
|
||||
|
||||
if ($cur = $result->fetch_row()) {
|
||||
$result->close();
|
||||
return MD_STD_IN::sanitize_text($cur[0]);
|
||||
}
|
||||
$result->close();
|
||||
|
||||
return "";
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user