Code Duplication    Length = 5-6 lines in 2 locations

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

@@ 5030-5034 (lines=5) @@
5027
function api_set_setting_option($params)
5028
{
5029
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
5030
    if (empty($params['id'])) {
5031
        Database::insert($table, $params);
5032
    } else {
5033
        Database::update($table, $params, array('id = ? '=> $params['id']));
5034
    }
5035
}
5036
5037
/**
@@ 5045-5050 (lines=6) @@
5042
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
5043
    $url_id = api_get_current_access_url_id();
5044
5045
    if (empty($params['id'])) {
5046
        $params['access_url'] = $url_id;
5047
        Database::insert($table, $params);
5048
    } else {
5049
        Database::update($table, $params, array('id = ? '=> array($params['id'])));
5050
    }
5051
}
5052
5053
/**