Code Duplication    Length = 5-6 lines in 2 locations

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

@@ 4917-4921 (lines=5) @@
4914
 */
4915
function api_set_setting_option($params) {
4916
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
4917
    if (empty($params['id'])) {
4918
        Database::insert($table, $params);
4919
    } else {
4920
        Database::update($table, $params, array('id = ? '=> $params['id']));
4921
    }
4922
}
4923
4924
/**
@@ 4931-4936 (lines=6) @@
4928
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
4929
    $url_id = api_get_current_access_url_id();
4930
4931
    if (empty($params['id'])) {
4932
        $params['access_url'] = $url_id;
4933
        Database::insert($table, $params);
4934
    } else {
4935
        Database::update($table, $params, array('id = ? '=> array($params['id'])));
4936
    }
4937
}
4938
4939
/**