You are here

public function Entity::rollback in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate/src/Plugin/migrate/destination/Entity.php \Drupal\migrate\Plugin\migrate\destination\Entity::rollback()

Delete the specified destination object from the target Drupal.

Parameters

array $destination_identifier: The ID of the destination object to delete.

Overrides DestinationBase::rollback

File

core/modules/migrate/src/Plugin/migrate/destination/Entity.php, line 157
Contains \Drupal\migrate\Plugin\migrate\destination\Entity.

Class

Entity
Plugin annotation @MigrateDestination( id = "entity", deriver = "Drupal\migrate\Plugin\Derivative\MigrateEntity" )

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

public function rollback(array $destination_identifier) {

  // Delete the specified entity from Drupal if it exists.
  $entity = $this->storage
    ->load(reset($destination_identifier));
  if ($entity) {
    $entity
      ->delete();
  }
}