Code Duplication    Length = 5-6 lines in 2 locations

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

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