function cis_helper_cron

cis7 cis_helper.module cis_helper_cron()

Implements hook_cron().

File

profiles/cis/modules/custom/cis_helper/cis_helper.module, line 20
Workflow and functionality glue based on the structure of the CIS.

Code

function cis_helper_cron() {
  $query = new EntityFieldQuery;
  $result = $query
  // pull all field collections
  ->entityCondition('entity_type', 'field_collection_item')
  // that are sections
  ->entityCondition('bundle', 'field_sections')
  // that aren't archived
  ->propertyCondition('archived', 0)
  // that have something in the cis_ops field
  ->fieldCondition('field_cis_ops', 'value', 'NULL', '!=')
  // run as user 1 to avoid issues of ability to load as cron is anon
  ->addMetaData('account', user_load(1))->execute();
  // load the instances
  if (isset($result['field_collection_item'])) {
    $sections = entity_load('field_collection_item', array_keys($result['field_collection_item']));
    foreach ($sections as $section) {
      // handle the logic of the operation to perform
      _cis_helper_run_operation($section);
    }
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.