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

Breadcrumb

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

function PreExistingConfigException::create

Creates an exception for an extension and a list of configuration objects.

Parameters

$extension: The name of the extension that is being installed.

array $config_objects: A list of configuration objects that already exist in active configuration, keyed by config collection.

Return value

$this

1 call to PreExistingConfigException::create()
ConfigInstaller::checkConfigurationToInstall in core/lib/Drupal/Core/Config/ConfigInstaller.php
Checks the configuration that will be installed for an extension.

File

core/lib/Drupal/Core/Config/PreExistingConfigException.php, line 58

Class

PreExistingConfigException
An exception thrown if configuration with the same name already exists.

Namespace

Drupal\Core\Config

Code

public static function create($extension, array $config_objects) {
    $message = new FormattableMarkup('Configuration objects (@config_names) provided by @extension already exist in active configuration', [
        '@config_names' => implode(', ', static::flattenConfigObjects($config_objects)),
        '@extension' => $extension,
    ]);
    $e = new static($message);
    $e->configObjects = $config_objects;
    $e->extension = $extension;
    return $e;
}

API Navigation

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