Code Duplication    Length = 5-6 lines in 2 locations

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

@@ 4957-4961 (lines=5) @@
4954
 */
4955
function api_set_setting_option($params) {
4956
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
4957
    if (empty($params['id'])) {
4958
        Database::insert($table, $params);
4959
    } else {
4960
        Database::update($table, $params, array('id = ? '=> $params['id']));
4961
    }
4962
}
4963
4964
/**
@@ 4971-4976 (lines=6) @@
4968
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
4969
    $url_id = api_get_current_access_url_id();
4970
4971
    if (empty($params['id'])) {
4972
        $params['access_url'] = $url_id;
4973
        Database::insert($table, $params);
4974
    } else {
4975
        Database::update($table, $params, array('id = ? '=> array($params['id'])));
4976
    }
4977
}
4978
4979
/**