You are here

function ctools_export_crud_load in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/export.inc \ctools_export_crud_load()

Load a single exportable object.

Parameters

$table: The name of the table to use to retrieve $schema values. This table must have an 'export' section containing data or this function will fail.

$name: The unique ID to load. The field for this ID will be specified by the export key, which normally defaults to 'name'.

Return value

The loaded object.

Related topics

9 calls to ctools_export_crud_load()
ctools_custom_content_type_content_type in plugins/content_types/custom/custom.inc
Return the custom content types with the specified $subtype_id.
ctools_custom_content_type_edit_form_validate in plugins/content_types/custom/custom.inc
The validate form to ensure the custom content data is okay.
ctools_custom_content_type_get_conf in plugins/content_types/custom/custom.inc
Given a subtype and a $conf, return the actual settings to use.
ctools_export_ui_context_cache_get in ./ctools.module
Cache callback on behalf of ctools_export_ui.
ctools_export_ui_ctools_access_get in ./ctools.module
Callback for access control ajax form on behalf of export ui.

... See full list

File

includes/export.inc, line 73
Contains code to make it easier to have exportable objects.

Code

function ctools_export_crud_load($table, $name) {
  $schema = ctools_export_get_schema($table);
  $export = $schema['export'];
  if (!empty($export['load callback']) && function_exists($export['load callback'])) {
    return $export['load callback']($name);
  }
  else {
    $result = ctools_export_load_object($table, 'names', array(
      $name,
    ));
    if (isset($result[$name])) {
      return $result[$name];
    }
  }
}