You are here

function field_group_unpack in Field Group 7.2

Same name and namespace in other branches
  1. 7 field_group.module \field_group_unpack()

Unpacks a database row in a FieldGroup object.

Parameters

$group: Database result object with stored group data.

Return value

$group Field group object.

2 calls to field_group_unpack()
field_group_load_field_group in ./field_group.module
Loads a group definition.
field_group_read_groups in ./field_group.module
Read all groups.

File

./field_group.module, line 1468
Fieldgroup module.

Code

function field_group_unpack($group) {

  // Extract unserialized data.
  if (isset($group->data)) {
    $data = $group->data;
    unset($group->data);
    $group->label = $data['label'];
    $group->weight = $data['weight'];
    $group->children = $data['children'];
    $group->format_type = !empty($data['format_type']) ? $data['format_type'] : 'fieldset';
    if (isset($data['format_settings'])) {
      $group->format_settings = $data['format_settings'];
    }
  }
  return $group;
}