Code Duplication    Length = 5-6 lines in 2 locations

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

@@ 5060-5064 (lines=5) @@
5057
 */
5058
function api_set_setting_option($params) {
5059
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
5060
    if (empty($params['id'])) {
5061
        Database::insert($table, $params);
5062
    } else {
5063
        Database::update($table, $params, array('id = ? '=> $params['id']));
5064
    }
5065
}
5066
5067
/**
@@ 5074-5079 (lines=6) @@
5071
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
5072
    $url_id = api_get_current_access_url_id();
5073
5074
    if (empty($params['id'])) {
5075
        $params['access_url'] = $url_id;
5076
        Database::insert($table, $params);
5077
    } else {
5078
        Database::update($table, $params, array('id = ? '=> array($params['id'])));
5079
    }
5080
}
5081
5082
/**