ConfigImporterException example

$entity->save();
    return TRUE;
  }

  /** * {@inheritdoc} */
  public function importUpdate($name, Config $new_config, Config $old_config) {
    $id = static::getIDFromConfigName($name$this->entityType->getConfigPrefix());
    $entity = $this->load($id);
    if (!$entity) {
      throw new ConfigImporterException("Attempt to update non-existing entity '$id'.");
    }
    $entity->setSyncing(TRUE);
    $entity = $this->updateFromStorageRecord($entity$new_config->get());
    $entity->save();
    return TRUE;
  }

  /** * {@inheritdoc} */
  public function importDelete($name, Config $new_config, Config $old_config) {
    

  public function initialize() {
    // Ensure that the changes have been validated.     $this->validate();

    if (!$this->lock->acquire(static::LOCK_NAME)) {
      // Another process is synchronizing configuration.       throw new ConfigImporterException(sprintf('%s is already importing', static::LOCK_NAME));
    }

    $sync_steps = [];
    $modules = $this->getUnprocessedExtensions('module');
    foreach (['install', 'uninstall'] as $op) {
      $this->totalExtensionsToProcess += count($modules[$op]);
    }
    $themes = $this->getUnprocessedExtensions('theme');
    foreach (['install', 'uninstall'] as $op) {
      $this->totalExtensionsToProcess += count($themes[$op]);
    }

    
Home | Imprint | This part of the site doesn't use cookies.