public static function PreExistingConfigException::create

public static PreExistingConfigException::create($extension, array $config_objects)

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

\Drupal\Core\Config\PreExistingConfigException

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 = SafeMarkup::format('Configuration objects (@config_names) provided by @extension already exist in active configuration', 
  array(
    '@config_names' => implode(', ', static::flattenConfigObjects($config_objects)),
    '@extension' => $extension
  )
  );
  $e = new static($message);
  $e->configObjects = $config_objects;
  $e->extension = $extension;
  return $e;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!PreExistingConfigException.php/function/PreExistingConfigException::create/8.1.x