Code Duplication    Length = 5-6 lines in 2 locations

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

@@ 5159-5163 (lines=5) @@
5156
 */
5157
function api_set_setting_option($params) {
5158
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
5159
    if (empty($params['id'])) {
5160
        Database::insert($table, $params);
5161
    } else {
5162
        Database::update($table, $params, array('id = ? '=> $params['id']));
5163
    }
5164
}
5165
5166
/**
@@ 5173-5178 (lines=6) @@
5170
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
5171
    $url_id = api_get_current_access_url_id();
5172
5173
    if (empty($params['id'])) {
5174
        $params['access_url'] = $url_id;
5175
        Database::insert($table, $params);
5176
    } else {
5177
        Database::update($table, $params, array('id = ? '=> array($params['id'])));
5178
    }
5179
}
5180
5181
/**