file_field_insert
function file_field_insert
file_field_insert($entity_type, $entity, $field, $instance, $langcode, &$items)
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); } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!file!file.field.inc/function/file_field_insert/7.x