Пример #1
0
/**
 * Determines if a grouping with a specified id exists
 * @param int $groupingid The grouping id. 
 * @return True if the grouping exists, false otherwise or if an error occurred. 
 */
function groups_grouping_exists($groupingid)
{
    return groups_db_grouping_exists($groupingid);
}
Пример #2
0
/**
 * Set information about a grouping
 * @param int $groupingid The grouping to update the info for.
 * @param object $groupingsettings 
 */
function groups_db_set_grouping_settings($groupingid, $groupingsettings)
{
    $success = true;
    if (!$groupingid or !$groupingsettings or !groups_db_grouping_exists($groupingid)) {
        $success = false;
    } else {
        // Replace any empty group settings.
        $record = $groupingsettings;
        $record->id = $groupingid;
        $record->timemodified = time();
        $result = update_record('groups_groupings', $record);
        if (!$result) {
            $success = false;
        }
    }
    return $success;
}