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

Breadcrumb

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

function EntityConfigBase::rollback

Overrides Entity::rollback

4 calls to EntityConfigBase::rollback()
EntityFieldStorageConfig::rollback in core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php
Delete the specified destination object from the target Drupal.
EntityFieldStorageConfig::rollback in core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php
Delete the specified destination object from the target Drupal.
EntityViewMode::rollback in core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php
Delete the specified destination object from the target Drupal.
EntityViewMode::rollback in core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php
Delete the specified destination object from the target Drupal.
2 methods override EntityConfigBase::rollback()
EntityFieldStorageConfig::rollback in core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php
Delete the specified destination object from the target Drupal.
EntityViewMode::rollback in core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php
Delete the specified destination object from the target Drupal.

File

core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php, line 283

Class

EntityConfigBase
Base destination class for importing configuration entities.

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

public function rollback(array $destination_identifier) {
    if ($this->isTranslationDestination()) {
        // The entity id does not include the langcode.
        $id_values = [];
        foreach ($destination_identifier as $key => $value) {
            if ($this->isTranslationDestination() && $key === 'langcode') {
                continue;
            }
            $id_values[] = $value;
        }
        $entity_id = implode('.', $id_values);
        $language = $destination_identifier['langcode'];
        $config = $this->storage
            ->load($entity_id)
            ->getConfigDependencyName();
        $config_override = $this->languageManager
            ->getLanguageConfigOverride($language, $config);
        // Rollback the translation.
        $config_override->delete();
    }
    else {
        $destination_identifier = implode('.', $destination_identifier);
        parent::rollback([
            $destination_identifier,
        ]);
    }
}

API Navigation

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