diff --git a/src/NodaLogEdit.php b/src/NodaLogEdit.php index 74b63a2..b32c0f7 100644 --- a/src/NodaLogEdit.php +++ b/src/NodaLogEdit.php @@ -30,6 +30,7 @@ final class NodaLogEdit { 'synchronize', 'status', 'translation', + 'group', ]; /** diff --git a/src/NodaNameGetter.php b/src/NodaNameGetter.php index 02813b5..755be29 100644 --- a/src/NodaNameGetter.php +++ b/src/NodaNameGetter.php @@ -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 ""; + + } }