Code Duplication    Length = 5-6 lines in 2 locations

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

@@ 5065-5069 (lines=5) @@
5062
 */
5063
function api_set_setting_option($params) {
5064
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
5065
    if (empty($params['id'])) {
5066
        Database::insert($table, $params);
5067
    } else {
5068
        Database::update($table, $params, array('id = ? '=> $params['id']));
5069
    }
5070
}
5071
5072
/**
@@ 5079-5084 (lines=6) @@
5076
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
5077
    $url_id = api_get_current_access_url_id();
5078
5079
    if (empty($params['id'])) {
5080
        $params['access_url'] = $url_id;
5081
        Database::insert($table, $params);
5082
    } else {
5083
        Database::update($table, $params, array('id = ? '=> array($params['id'])));
5084
    }
5085
}
5086
5087
/**