ctools_export_set_object_status

  1. drupal
    1. 6 export.inc function
    2. 7 export.inc function
Drupal 7 ctools_export_set_object_status($object, $new_status = TRUE)

Set the status of a default $object as a variable.

This is more efficient than ctools_export_set_status because it will actually unset the variable entirely if it's not necessary, this saving a bit of space.

4 calls to ctools_export_set_object_status()

File

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

Code

function ctools_export_set_object_status($object, $new_status = TRUE) {
  $table = $object->table;
  $schema = ctools_export_get_schema($table);
  $export = $schema['export'];
  $status = variable_get($export['status'], array());

  // Compare
  if (!$new_status && $object->export_type & EXPORT_IN_DATABASE) {
    unset($status[$object->{$export['key']}]);
  }
  else {
    $status[$object->{$export['key']}] = $new_status;
  }

  variable_set($export['status'], $status);
}