You are here

function multifield_update_maximum_id in Multifield 7

Same name and namespace in other branches
  1. 7.2 multifield.module \multifield_update_maximum_id()
3 calls to multifield_update_maximum_id()
drush_multifield_convert_field_collection_table in ./multifield.drush.inc
multifield_field_insert in ./multifield.field.inc
Implements hook_field_insert().
multifield_field_update in ./multifield.field.inc
Implements hook_field_update().

File

./multifield.module, line 462

Code

function multifield_update_maximum_id(array $items) {
  if (!empty($items)) {
    $max_id =& multifield_get_maximum_id();
    $ids = array();
    foreach ($items as $item) {
      $ids[] = $item['id'];
    }
    $largest_id = max($ids);
    if ($largest_id >= $max_id) {
      $max_id = $largest_id;
      variable_set('multifield_max_id', $largest_id);
    }
  }
}