function file_field_insert

Implements hook_field_insert().

1 call to file_field_insert()
image_field_insert in drupal/core/modules/image/image.field.inc
Implements hook_field_insert().

File

drupal/core/modules/file/file.field.inc, line 219
Field module functionality for the File module.

Code

function file_field_insert($entity_type, $entity, $field, $instance, $langcode, &$items) {

  // Add a new usage of each uploaded file.
  foreach ($items as $item) {
    file_usage()
      ->add(file_load($item['fid']), 'file', $entity_type, $entity
      ->id());
  }
}