You are here

function multifield_item_unserialize in Multifield 7.2

Same name and namespace in other branches
  1. 7 multifield.module \multifield_item_unserialize()
1 string reference to 'multifield_item_unserialize'
multifield_field_load in ./multifield.field.inc
Implements hook_field_load().

File

./multifield.module, line 411

Code

function multifield_item_unserialize(&$item, $delta, $machine_name) {
  foreach (multifield_type_get_subfields($machine_name) as $subfield_name) {
    $subfield = field_info_field($subfield_name);
    foreach (array_keys($subfield['columns']) as $column) {
      if (array_key_exists($subfield_name . '_' . $column, $item)) {
        $item[$subfield_name][LANGUAGE_NONE][0][$column] = $item[$subfield_name . '_' . $column];
        unset($item[$subfield_name . '_' . $column]);
      }
    }
  }
}