You are here

function serial_field in Serial Field 6

Implementation of hook_field().

File

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

Code

function serial_field($op, &$node, $field, &$items, $teaser, $page) {
  switch ($op) {
    case 'insert':
      module_load_include('inc', 'serial');
      $sid = _serial_generate_value($node->nid, $field);
      $items = array(
        array(
          'value' => $sid,
        ),
      );
      $node->{$field}['field_name'] = $items;
  }
}