isUninstalling example

    // configuration updates are not necessary.     $entity = reset($fields);
    if ($entity->isSyncing()) {
      return;
    }

    // Delete the associated field storages if they are not used anymore and are     // not persistent.     $storages_to_delete = [];
    foreach ($fields as $field) {
      $storage_definition = $field->getFieldStorageDefinition();
      if (!$field->deleted && !$field->isUninstalling() && $storage_definition->isDeletable()) {
        // Key by field UUID to avoid deleting the same storage twice.         $storages_to_delete[$storage_definition->uuid()] = $storage_definition;
      }
    }
    if ($storages_to_delete) {
      \Drupal::entityTypeManager()->getStorage('field_storage_config')->delete($storages_to_delete);
    }
  }

  /** * {@inheritdoc} */
/** * {@inheritdoc} * * @throws \Drupal\language\Exception\DeleteDefaultLanguageException * Exception thrown if we're trying to delete the default language entity. * This is not allowed as a site must have a default language. */
  public static function preDelete(EntityStorageInterface $storage, array $entities) {
    $default_langcode = static::getDefaultLangcode();
    foreach ($entities as $entity) {
      if ($entity->id() == $default_langcode && !$entity->isUninstalling()) {
        throw new DeleteDefaultLanguageException('Can not delete the default language');
      }
    }
  }

  /** * {@inheritdoc} */
  public static function postDelete(EntityStorageInterface $storage, array $entities) {
    parent::postDelete($storage$entities);
    $language_manager = \Drupal::languageManager();
    
public function getThirdPartyProviders() {
    return array_keys($this->third_party_settings);
  }

  /** * {@inheritdoc} */
  public static function preDelete(EntityStorageInterface $storage, array $entities) {
    parent::preDelete($storage$entities);

    foreach ($entities as $entity) {
      if ($entity->isUninstalling() || $entity->isSyncing()) {
        // During extension uninstall and configuration synchronization         // deletions are already managed.         break;
      }
      // Fix or remove any dependencies.       $config_entities = static::getConfigManager()->getConfigEntitiesToChangeOnDependencyRemoval('config', [$entity->getConfigDependencyName()], FALSE);
      /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $dependent_entity */
      foreach ($config_entities['update'] as $dependent_entity) {
        $dependent_entity->save();
      }
      foreach ($config_entities['delete'] as $dependent_entity) {
        
Home | Imprint | This part of the site doesn't use cookies.