You are here

function elysia_cron_ctools_export_load_all in Elysia Cron 7.2

Same name and namespace in other branches
  1. 6.2 elysia_cron.ctools.inc \elysia_cron_ctools_export_load_all()
  2. 6 elysia_cron.ctools.inc \elysia_cron_ctools_export_load_all()
  3. 7 elysia_cron.ctools.inc \elysia_cron_ctools_export_load_all()

Ctools load all callback.

Ctools does not support override of PARTIAL record, this is an elysia cron specific replacement to support it.

Return value

array Array of object to export.

1 call to elysia_cron_ctools_export_load_all()
elysia_cron_ctools_to_hook_code in ./elysia_cron.ctools.inc
Ctools export to hook code callback.
1 string reference to 'elysia_cron_ctools_export_load_all'
elysia_cron_schema in ./elysia_cron.install
Implements hook_schema().

File

./elysia_cron.ctools.inc, line 75
Ctools integration.

Code

function elysia_cron_ctools_export_load_all() {
  $result = array();
  $schema = ctools_export_get_schema('elysia_cron');
  if (empty($schema)) {
    return $result;
  }
  $export = $schema['export'];
  $objects = db_select('elysia_cron', 'ec')
    ->fields('ec', _elysia_cron_columns())
    ->execute()
    ->fetchAll();
  $default_objects = _ctools_export_get_defaults('elysia_cron', $export);
  foreach ($objects as $object) {
    $key = $object->{$export['key']};
    if (isset($default_objects[$key])) {
      $result[$key] = _elysia_cron_ctools_export_load_object_db_and_code($object, $default_objects[$key], $export);
      unset($default_objects[$key]);
    }
    else {
      $result[$key] = _elysia_cron_ctools_export_load_object_db($object, $export);
    }
  }
  foreach ($default_objects as $key => $object) {
    $result[$key] = _elysia_cron_ctools_export_load_object_code($object, $export);
  }
  return $result;
}