Code Duplication    Length = 5-6 lines in 2 locations

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

@@ 4931-4935 (lines=5) @@
4928
 */
4929
function api_set_setting_option($params) {
4930
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
4931
    if (empty($params['id'])) {
4932
        Database::insert($table, $params);
4933
    } else {
4934
        Database::update($table, $params, array('id = ? '=> $params['id']));
4935
    }
4936
}
4937
4938
/**
@@ 4945-4950 (lines=6) @@
4942
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
4943
    $url_id = api_get_current_access_url_id();
4944
4945
    if (empty($params['id'])) {
4946
        $params['access_url'] = $url_id;
4947
        Database::insert($table, $params);
4948
    } else {
4949
        Database::update($table, $params, array('id = ? '=> array($params['id'])));
4950
    }
4951
}
4952
4953
/**