You are here

protected function EntityReferenceRevisions::rollbackNonTranslation in Entity Reference Revisions 8

Rollback non-translation destinations.

Parameters

array $destination_identifiers: The IDs of the destination object to delete.

1 call to EntityReferenceRevisions::rollbackNonTranslation()
EntityReferenceRevisions::rollback in src/Plugin/migrate/destination/EntityReferenceRevisions.php
Delete the specified destination object from the target Drupal.

File

src/Plugin/migrate/destination/EntityReferenceRevisions.php, line 198

Class

EntityReferenceRevisions
Provides entity_reference_revisions destination plugin.

Namespace

Drupal\entity_reference_revisions\Plugin\migrate\destination

Code

protected function rollbackNonTranslation(array $destination_identifiers) {
  $revision_id = array_pop($destination_identifiers);
  $entity = $this->storage
    ->loadRevision($revision_id);
  if ($entity) {
    if ($entity
      ->isDefaultRevision()) {
      $entity
        ->delete();
    }
    else {
      $this->storage
        ->deleteRevision($revision_id);
    }
  }
}