Code Duplication    Length = 5-6 lines in 2 locations

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

@@ 5047-5051 (lines=5) @@
5044
function api_set_setting_option($params)
5045
{
5046
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
5047
    if (empty($params['id'])) {
5048
        Database::insert($table, $params);
5049
    } else {
5050
        Database::update($table, $params, array('id = ? '=> $params['id']));
5051
    }
5052
}
5053
5054
/**
@@ 5062-5067 (lines=6) @@
5059
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
5060
    $url_id = api_get_current_access_url_id();
5061
5062
    if (empty($params['id'])) {
5063
        $params['access_url'] = $url_id;
5064
        Database::insert($table, $params);
5065
    } else {
5066
        Database::update($table, $params, array('id = ? '=> array($params['id'])));
5067
    }
5068
}
5069
5070
/**