You are here

function field_group_pack in Field Group 7

Same name and namespace in other branches
  1. 7.2 field_group.module \field_group_pack()

Packs a FieldGroup object into a database row.

Parameters

$group: FieldGroup object.

Return value

$record Database row object, ready to be inserted/update

1 call to field_group_pack()
field_group_group_save in ./field_group.module
field_group_group_save().

File

./field_group.module, line 1800
Fieldgroup module.

Code

function field_group_pack($group) {
  $record = clone $group;
  $record->data = array(
    'label' => $record->label,
    'weight' => $record->weight,
    'children' => $record->children,
    'format_type' => !empty($record->format_type) ? $record->format_type : 'fieldset',
  );
  if (isset($record->format_settings)) {
    $record->data['format_settings'] = $record->format_settings;
  }
  return $record;
}