/**
* Method to return the title of a user group
*
* @param integer $groupId Id of the group for which to get the title of.
*
* @return string The title of the group
*
* @since 3.5
*/
public static function getGroupTitle($groupId)
{
// Cast as integer until method is typehinted.
$groupId = (int) $groupId;
// Fetch the group title from the database
$db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName('title'))->from($db->quoteName('#__usergroups'))->where($db->quoteName('id') . ' = :groupId')->bind(':groupId', $groupId, ParameterType::INTEGER);
$db->setQuery($query);
return $db->loadResult();
}