function recommender_app_remove in Recommender API 7.4
Remove the application. Usually used in calling module's hook_uninstall()
Parameters
$apps the application name to be removed.:
Return value
null
1 call to recommender_app_remove()
- recommender_app_unregister in ./
recommender.module - TODO: remove old code.
File
- ./
recommender.module, line 83 - Providing generic recommender system algorithms.
Code
function recommender_app_remove($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_preference} WHERE app_id=:app_id", array(
':app_id' => $app_id,
));
db_query("DELETE FROM {recommender_similarity} WHERE app_id=:app_id", array(
':app_id' => $app_id,
));
db_query("DELETE FROM {recommender_prediction} WHERE app_id=:app_id", array(
':app_id' => $app_id,
));
db_query("DELETE FROM {recommender_app} WHERE id=:app_id", array(
':app_id' => $app_id,
));
}
}