You are here

function serial_field_presave in Serial Field 7

Implements hook_field_presave().

File

./serial.module, line 88
The Serial module main file.

Code

function serial_field_presave($entity_type, $entity, array $field, array $instance, $langcode, array &$items) {
  if (empty($items)) {
    module_load_include('inc', 'serial');
    $items[] = array(
      'value' => _serial_generate_value($entity_type, $instance['bundle'], $field['field_name']),
    );
  }
}