You are here

function field_group_group_save in Field Group 7

Same name and namespace in other branches
  1. 8.3 field_group.module \field_group_group_save()
  2. 8 field_group.module \field_group_group_save()
  3. 7.2 field_group.module \field_group_group_save()

field_group_group_save().

Saves a group definition. This function is called by ctools export when calls are made through ctools_export_crud_save().

Parameters

$group: A group definition.

1 string reference to 'field_group_group_save'
field_group_schema in ./field_group.install
Implements hook_schema().

File

./field_group.module, line 1860
Fieldgroup module.

Code

function field_group_group_save(&$group) {

  // Prepare the record.
  $object = field_group_pack($group);
  if (isset($object->export_type) && $object->export_type & EXPORT_IN_DATABASE) {

    // Existing record.
    $update = array(
      'id',
    );
    module_invoke_all('field_group_update_field_group', $object);
  }
  else {

    // New record.
    $update = array();
    $object->export_type = EXPORT_IN_DATABASE;
    module_invoke_all('field_group_create_field_group', $object);
  }
  return drupal_write_record('field_group', $object, $update);
}