function nodereference_count_field_presave in Nodereference Count 7
Implements hook_field_presave().
File
- ./
nodereference_count.module, line 148 - Defines a field type for counting the references to a node.
Code
function nodereference_count_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
if ($field['type'] == 'nodereference_count' && $entity_type == 'node') {
$items[0]['count'] = nodereference_count_get_count($instance['settings'], $entity->nid);
}
}