function file_field_insert in Drupal 7
Implements hook_field_insert().
1 call to file_field_insert()
- image_field_insert in modules/
image/ image.field.inc - Implements hook_field_insert().
File
- modules/
file/ file.field.inc, line 239 - Field module functionality for the File module.
Code
function file_field_insert($entity_type, $entity, $field, $instance, $langcode, &$items) {
list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
// Add a new usage of each uploaded file.
foreach ($items as $item) {
$file = (object) $item;
file_usage_add($file, 'file', $entity_type, $id);
}
}