You are here

function elysia_cron_ctools_export_load in Elysia Cron 7.2

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

Ctools load callback.

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

Parameters

string $name: Cron job name.

Return value

object|null Object to export or NULL if nothing found.

1 string reference to 'elysia_cron_ctools_export_load'
elysia_cron_schema in ./elysia_cron.install
Implements hook_schema().

File

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

Code

function elysia_cron_ctools_export_load($name) {
  $schema = ctools_export_get_schema('elysia_cron');
  if (!empty($schema)) {
    $export = $schema['export'];
    $object = db_select('elysia_cron', 'ec')
      ->fields('ec', _elysia_cron_columns())
      ->condition('name', $name)
      ->execute()
      ->fetch();
    $default_objects = _ctools_export_get_defaults('elysia_cron', $export);
    if ($object) {
      if (isset($default_objects[$name])) {
        return _elysia_cron_ctools_export_load_object_db_and_code($object, $default_objects[$name], $export);
      }
      else {
        return _elysia_cron_ctools_export_load_object_db($object, $export);
      }
    }
    elseif (isset($default_objects[$name])) {
      return _elysia_cron_ctools_export_load_object_code($default_objects[$name], $export);
    }
  }
}