You are here

function subscriptions_content_cron in Subscriptions 7

Same name and namespace in other branches
  1. 5.2 subscriptions_content.module \subscriptions_content_cron()
  2. 6 subscriptions_content.module \subscriptions_content_cron()
  3. 2.0.x subscriptions_content/subscriptions_content.module \subscriptions_content_cron()

Implements hook_cron().

Ensure that we're heavier than the taxonomy.module.

File

./subscriptions_content.module, line 817
Subscriptions to content events

Code

function subscriptions_content_cron() {
  $result = db_query("SELECT name, weight FROM {system} WHERE name IN ('taxonomy', 'subscriptions_content') AND type = 'module'");
  $weights = array();
  foreach ($result as $module) {
    $weights[$module->name] = $module->weight;
  }
  if ($weights['subscriptions_content'] <= $weights['taxonomy']) {
    db_update('system')
      ->fields(array(
      'weight' => $weights['taxonomy'] + 1,
    ))
      ->condition('name', 'subscriptions_content')
      ->condition('type', 'module')
      ->execute();
  }
}