You are here

function hook_field_collection_item_insert in Field collection 7

Responds when a field collection item is inserted.

This hook is invoked after the field collection item is inserted into the database.

Parameters

FieldCollectionItemEntity $field_collection_item: The field collection item that is being inserted.

See also

hook_entity_insert()

File

./field_collection.api.php, line 59
Contains API documentation and examples for the Field Collection.

Code

function hook_field_collection_item_insert(FieldCollectionItemEntity $field_collection_item) {
  db_insert('mytable')
    ->fields(array(
    'id' => entity_id('field_collection_item', $field_collection_item),
    'extra' => print_r($field_collection_item, TRUE),
  ))
    ->execute();
}