Code Duplication    Length = 5-6 lines in 2 locations

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

@@ 5145-5149 (lines=5) @@
5142
 */
5143
function api_set_setting_option($params) {
5144
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
5145
    if (empty($params['id'])) {
5146
        Database::insert($table, $params);
5147
    } else {
5148
        Database::update($table, $params, array('id = ? '=> $params['id']));
5149
    }
5150
}
5151
5152
/**
@@ 5159-5164 (lines=6) @@
5156
    $table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
5157
    $url_id = api_get_current_access_url_id();
5158
5159
    if (empty($params['id'])) {
5160
        $params['access_url'] = $url_id;
5161
        Database::insert($table, $params);
5162
    } else {
5163
        Database::update($table, $params, array('id = ? '=> array($params['id'])));
5164
    }
5165
}
5166
5167
/**