You are here

function ctools_export_crud_export in Chaos Tool Suite (ctools) 7

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

Get the exported code of 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.

$object: The fully populated object to delete, or the export key.

$indent: Any indentation to apply to the code, in case this object is embedded into another, for example.

Return value

A string containing the executable export of the object.

Related topics

4 calls to ctools_export_crud_export()
ctools_export_default_to_hook_code in includes/export.inc
Default function to export objects to code.
ctools_export_ui::clone_page in plugins/export_ui/ctools_export_ui.class.php
Main entry point to clone an item.
ctools_export_ui::export_page in plugins/export_ui/ctools_export_ui.class.php
Page callback to display export information for an exportable item.
_ctools_drush_export_view in drush/ctools.drush.inc
View a single object.

File

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

Code

function ctools_export_crud_export($table, $object, $indent = '') {
  $schema = ctools_export_get_schema($table);
  $export = $schema['export'];
  if (!empty($export['export callback']) && function_exists($export['export callback'])) {
    return $export['export callback']($object, $indent);
  }
  else {
    return ctools_export_object($table, $object, $indent);
  }
}