Code Duplication    Length = 5-6 lines in 2 locations

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

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