Code Duplication    Length = 5-6 lines in 2 locations

main/inc/lib/api.lib.php 2 locations

@@ 4970-4974 (lines=5) @@
4967
 */
4968
function api_set_setting_option($params) {
4969
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
4970
    if (empty($params['id'])) {
4971
        Database::insert($table, $params);
4972
    } else {
4973
        Database::update($table, $params, array('id = ? '=> $params['id']));
4974
    }
4975
}
4976
4977
/**
@@ 4984-4989 (lines=6) @@
4981
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
4982
    $url_id = api_get_current_access_url_id();
4983
4984
    if (empty($params['id'])) {
4985
        $params['access_url'] = $url_id;
4986
        Database::insert($table, $params);
4987
    } else {
4988
        Database::update($table, $params, array('id = ? '=> array($params['id'])));
4989
    }
4990
}
4991
4992
/**