You are here

function _recommender_process_periodic_callback in Recommender API 7.6

2 calls to _recommender_process_periodic_callback()
recommender_cron_process in ./recommender.module
recommender_upkeep_process in ./recommender.module

File

./recommender.module, line 409

Code

function _recommender_process_periodic_callback($timestamp, $hook_callback) {
  $data = recommender_fetch_data();
  $callbacks = array();

  // add these to remove duplicates.
  foreach ($data as $rec => $def) {
    if (@$def[$hook_callback] && function_exists($def[$hook_callback])) {
      $callbacks[$def[$hook_callback]] = $def[$hook_callback];
    }
  }

  // shuffle them
  shuffle($callbacks);
  foreach ($callbacks as $callback) {
    $callback($timestamp);
  }
}