You are here

function minisite_field_insert in Mini site 7

Implements hook_field_insert().

File

includes/minisite.field.inc, line 105
Minisite field.

Code

function minisite_field_insert($entity_type, $entity, $field, $instance, $langcode, &$items) {
  list($id, , ) = 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, 'minisite', $entity_type, $id);
  }
}