From ff62d888895384c2c134cc3582c0d66de5715e11 Mon Sep 17 00:00:00 2001 From: Jennifer Hodgdon Date: Mon, 11 May 2015 14:58:17 -0700 Subject: [PATCH] Issue #2482215 by alexpott: Improve config_prefix documentation --- .../Core/Config/Entity/ConfigEntityType.php | 12 ++-------- .../Entity/ConfigEntityTypeInterface.php | 22 ++++++++++++------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php index 180d7acbed8..33cefbdd2ac 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php @@ -20,12 +20,7 @@ class ConfigEntityType extends EntityType implements ConfigEntityTypeInterface { /** * The config prefix set in the configuration entity type annotation. * - * The default configuration prefix is constructed from the name of the module - * that provides the entity type and the ID of the entity type. If a - * config_prefix annotation is present it will be used in place of the entity - * type ID. - * - * @see \Drupal\Core\Config\Entity\ConfigEntityType::getConfigPrefix() + * @see \Drupal\Core\Config\Entity\ConfigEntityTypeInterface::getConfigPrefix() */ protected $config_prefix; @@ -89,10 +84,7 @@ class ConfigEntityType extends EntityType implements ConfigEntityTypeInterface { */ public function getConfigPrefix() { // Ensure that all configuration entities are prefixed by the name of the - // module that provides the configuration entity type. This ensures that - // default configuration will be created as expected during module - // installation and dependencies can be calculated without the modules that - // provide the entity types being installed. + // module that provides the configuration entity type. if (isset($this->config_prefix)) { $config_prefix = $this->provider . '.' . $this->config_prefix; } diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityTypeInterface.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityTypeInterface.php index 668d9832bae..cd001394f4e 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityTypeInterface.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityTypeInterface.php @@ -49,15 +49,21 @@ interface ConfigEntityTypeInterface extends EntityTypeInterface { /** * Gets the config prefix used by the configuration entity type. * - * Ensures that all configuration entities are prefixed by the module that - * provides the configuration entity type. This ensures that if a - * configuration entity is contained in a extension's default configuration, - * it will be created during extension installation. Additionally, it allows - * dependencies to be calculated without the modules that provide - * configuration entity types being installed. + * The config prefix is used to prefix configuration entity IDs when they are + * stored in the configuration system. The default config prefix is + * constructed from the name of the module that provides the entity type and + * the ID of the entity type. If a config_prefix annotation is present it will + * be used in place of the entity type ID. * - * @return string|bool - * The config prefix, or FALSE if not a configuration entity type. + * Prefixing with the module that provides the configuration entity type + * ensures that configuration entities depend on the module that provides the + * configuration entity type. + * + * @return string + * The config prefix. + * + * @throws \Drupal\Core\Config\ConfigPrefixLengthException + * Exception thrown when the length of the prefix exceeds PREFIX_LENGTH. */ public function getConfigPrefix();