function recommender_app_unregister in Recommender API 6.3
Same name and namespace in other branches
- 7.3 recommender.module \recommender_app_unregister()
- 7.4 recommender.module \recommender_app_unregister()
Remove the application. Usually used in calling module's hook_uninstall()
Parameters
$apps the application name to be removed.:
Return value
null
File
- ./
recommender.module, line 79 - Providing generic recommender system algorithms.
Code
function recommender_app_unregister($apps) {
if (func_num_args() > 1) {
$apps = func_get_args();
// if used as recommender_app_unregister('app1', 'app2', ...);
}
elseif (!is_array($apps)) {
$apps = array(
$apps,
);
// if used as recommender_app_unregister('app');
}
// finally, used as recommender_app_unregister(array('app1', 'app2', ...);
foreach ($apps as $app) {
$app_id = recommender_app_load($app, TRUE);
db_query('DELETE FROM {recommender_similarity} WHERE app_id = %d', $app_id);
db_query('DELETE FROM {recommender_prediction} WHERE app_id = %d', $app_id);
db_query('DELETE FROM {recommender_app} WHERE id = %d', $app_id);
}
}