public function MigrateDestinationEntity::prepareRollback in Migrate 7.2
Same name and namespace in other branches
- 6.2 plugins/destinations/entity.inc \MigrateDestinationEntity::prepareRollback()
Give handlers a shot at cleaning up before an entity has been rolled back.
Parameters
$entity_id: ID of the entity about to be deleted..
6 calls to MigrateDestinationEntity::prepareRollback()
- MigrateDestinationComment::bulkRollback in plugins/
destinations/ comment.inc - Delete a batch of comments at once.
- MigrateDestinationFile::rollback in plugins/
destinations/ file.inc - Delete a file entry.
- MigrateDestinationNode::bulkRollback in plugins/
destinations/ node.inc - Delete a batch of nodes at once.
- MigrateDestinationNodeRevision::bulkRollback in plugins/
destinations/ node.inc - Rolls back any versions that have been created.
- MigrateDestinationTerm::rollback in plugins/
destinations/ term.inc - Delete a migrated term
File
- plugins/
destinations/ entity.inc, line 90 - Defines base for migration destinations implemented as Drupal entities.
Class
- MigrateDestinationEntity
- Abstract base class for entity-based destination handling. Holds common Field API-related functions.
Code
public function prepareRollback($entity_id) {
$migration = Migration::currentMigration();
// Call any general entity handlers (in particular, the builtin field handler)
migrate_handler_invoke_all('Entity', 'prepareRollback', $entity_id);
// Then call any entity-specific handlers
migrate_handler_invoke_all($this->entityType, 'prepareRollback', $entity_id);
// Then call any prepare handler for this specific Migration.
if (method_exists($migration, 'prepareRollback')) {
$migration
->prepareRollback($entity_id);
}
}