You are here

function domain_cron in Domain Access 7.3

Same name and namespace in other branches
  1. 5 domain.module \domain_cron()
  2. 6.2 domain.module \domain_cron()
  3. 7.2 domain.module \domain_cron()

Implements hook_cron().

This function invokes hook_domain_cron() and allows Domain Access modules to run functions for all active affiliates.

File

./domain.module, line 888
Core module functions for the Domain Access suite.

Code

function domain_cron() {

  // Check to see if this function is needed at all.
  $modules = module_implements('domain_cron');
  if (!empty($modules)) {

    // Get the domain list.
    $domains = domain_domains();

    // Run the hook for each active domain.
    foreach ($domains as $domain) {
      domain_set_domain($domain['domain_id'], TRUE);
      foreach ($modules as $module) {
        module_invoke($module, 'domain_cron', $domain);
      }
    }

    // Reset the active domain.
    domain_reset_domain(TRUE);
  }
}