You are here

public function Entity::rollback in Drupal 9

Same name and namespace in other branches
  1. 8 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

3 calls to Entity::rollback()
EntityConfigBase::rollback in core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php
Delete the specified destination object from the target Drupal.
EntityContentBase::rollback in core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php
Delete the specified destination object from the target Drupal.
EntityContentComplete::rollback in core/modules/migrate/src/Plugin/migrate/destination/EntityContentComplete.php
Delete the specified destination object from the target Drupal.
2 methods override Entity::rollback()
EntityConfigBase::rollback in core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php
Delete the specified destination object from the target Drupal.
EntityContentBase::rollback in core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php
Delete the specified destination object from the target Drupal.

File

core/modules/migrate/src/Plugin/migrate/destination/Entity.php, line 208

Class

Entity
Provides a generic destination to import entities.

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();
  }
}