function ctools_export_get_schema

cis7 export.inc ctools_export_get_schema($table)
cle7 export.inc ctools_export_get_schema($table)
elmsmedia7 export.inc ctools_export_get_schema($table)
icor7 export.inc ctools_export_get_schema($table)
meedjum_blog7 export.inc ctools_export_get_schema($table)
mooc7 export.inc ctools_export_get_schema($table)

Get the schema for a given table.

This looks for data the export subsystem needs and applies defaults so that it's easily available.

33 calls to ctools_export_get_schema()
ctools_component_features_export_options in sites/all/modules/ulmus/features/includes/features.ctools.inc
Master implementation of hook_features_export_options() for all ctools components.
ctools_component_features_export_render in sites/all/modules/ulmus/features/includes/features.ctools.inc
Master implementation of hook_features_export_render() for all ctools components.
ctools_export_crud_delete in sites/all/modules/ulmus/ctools/includes/export.inc
Delete a single exportable object.
ctools_export_crud_export in sites/all/modules/ulmus/ctools/includes/export.inc
Get the exported code of a single exportable object.
ctools_export_crud_import in sites/all/modules/ulmus/ctools/includes/export.inc
Turn exported code into an object.

... See full list

1 string reference to 'ctools_export_get_schema'
data_update_6002 in sites/all/modules/local_contrib/data/data.install
Add a primary key, required by CTools. Shorten name key to 128 char max.

File

sites/all/modules/ulmus/ctools/includes/export.inc, line 975
Contains code to make it easier to have exportable objects.

Code

function ctools_export_get_schema($table) {
  static $drupal_static_fast;
  if (!isset($drupal_static_fast)) {
    $drupal_static_fast['cache'] = &drupal_static(__FUNCTION__);
  }
  $cache = &$drupal_static_fast['cache'];

  if (empty($cache[$table])) {
    $schema = drupal_get_schema($table);

    // If our schema isn't loaded, it's possible we're in a state where it
    // simply hasn't been cached. If we've been asked, let's force the
    // issue.
    if (!$schema || empty($schema['export'])) {
      // force a schema reset:
      $schema = drupal_get_schema($table, TRUE);
    }

    if (!isset($schema['export'])) {
      return array();
    }

    if (empty($schema['module'])) {
      return array();
    }

    // Add some defaults
    $schema['export'] += array(
      'key' => 'name',
      'key name' => 'Name',
      'object' => 'stdClass',
      'status' => 'default_' . $table,
      'default hook' => 'default_' . $table,
      'can disable' => TRUE,
      'identifier' => $table,
      'primary key' => !empty($schema['primary key']) ? $schema['primary key'][0] : '',
      'bulk export' => TRUE,
      'list callback' => "$schema[module]_{$table}_list",
      'to hook code callback' => "$schema[module]_{$table}_to_hook_code",
      'cache defaults' => FALSE,
      'default cache bin' => 'cache',
      'export type string' => 'type',
      'boolean' => TRUE,
    );

    // If the export definition doesn't have the "primary key" then the CRUD
    // save callback won't work.
    if (empty($schema['export']['primary key']) && user_access('administer site configuration')) {
      drupal_set_message(t('The export definition of @table is missing the "primary key" property.', array('@table' => $table)), 'error');
    }

    // Notes:
    // The following callbacks may be defined to override default behavior
    // when using CRUD functions:
    //
    // create callback
    // load callback
    // load multiple callback
    // load all callback
    // save callback
    // delete callback
    // export callback
    // import callback
    //
    // See the appropriate ctools_export_crud function for details on what
    // arguments these callbacks should accept. Please do not call these
    // directly, always use the ctools_export_crud_* wrappers to ensure
    // that default implementations are honored.
    $cache[$table] = $schema;
  }

  return $cache[$table];
}
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.