You are here

function recommender_create_command in Recommender API 7.3

Same name and namespace in other branches
  1. 6.3 recommender.module \recommender_create_command()
  2. 7.4 recommender.module \recommender_create_command()
3 calls to recommender_create_command()
recommender_cron in ./recommender.module
recommender_settings_form_submit in ./recommender.admin.inc
rec_example_settings_form_submit in rec_example/rec_example.module

File

./recommender.module, line 135
Providing generic recommender system algorithms.

Code

function recommender_create_command($app_name) {
  $command = "runRecommender(); //{$app_name}";
  $app_id = recommender_app_load($app_name, TRUE);
  $execution_id = async_command_create_command('recommender', $command, array(
    'eid' => $app_id,
  ));
  if ($execution_id) {
    db_query('UPDATE {recommender_app} SET execution_id=:id WHERE name=:name', array(
      ':id' => $execution_id,
      ':name' => $app_name,
    ));
  }
  drupal_set_message(t('Your request "@command" in the queue. It will be executed asynchronously. Please refresh the page to see the update.', array(
    '@command' => $command,
  )));
}