Code Duplication    Length = 5-6 lines in 2 locations

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

@@ 4891-4895 (lines=5) @@
4888
 */
4889
function api_set_setting_option($params) {
4890
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
4891
    if (empty($params['id'])) {
4892
        Database::insert($table, $params);
4893
    } else {
4894
        Database::update($table, $params, array('id = ? '=> $params['id']));
4895
    }
4896
}
4897
4898
/**
@@ 4905-4910 (lines=6) @@
4902
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
4903
    $url_id = api_get_current_access_url_id();
4904
4905
    if (empty($params['id'])) {
4906
        $params['access_url'] = $url_id;
4907
        Database::insert($table, $params);
4908
    } else {
4909
        Database::update($table, $params, array('id = ? '=> array($params['id'])));
4910
    }
4911
}
4912
4913
/**