Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Entity.php

function Entity::rollback

Overrides DestinationBase::rollback

5 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.
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.
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 248

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) {
        if ($entity instanceof ContentEntityInterface) {
            $entity->setSyncing(TRUE);
        }
        $entity->delete();
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal