public function BiblioMigrateDestinationFieldCollection::rollback in Bibliography Module 7.3
Delete a migrated collection.
Parameters
$key: Array of fields representing the key.
File
- includes/
migrate/ plugins/ destinations/ biblio_field_collection.inc, line 105
Class
- BiblioMigrateDestinationFieldCollection
- Destination class implementing migration into field_collection.
Code
public function rollback(array $key) {
$item_id = reset($key);
$this
->prepareRollback($item_id);
$field_collection_item = field_collection_item_load($item_id);
// If the collection wasn't imported we can't roll it back so check if the
// loaded object matches the fieldcollection item class.
if ($field_collection_item instanceof FieldCollectionItemEntity) {
$field_collection_item
->delete();
}
$this
->completeRollback($item_id);
return TRUE;
}