Code Duplication    Length = 5-6 lines in 2 locations

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

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