diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php index 6d0a3f4..c4c2874 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php @@ -137,6 +137,16 @@ public function loadByProperties(array $values = array()) { } /** + * Returns the config prefix used by the configuration entity type. + * + * @return string + * The full configuration prefix, for example `views.view.`. + */ + public function getConfigPrefix() { + return $this->entityInfo['config_prefix'] . '.'; + } + + /** * Builds the query to load the entity. * * This has full revision support. For entities requiring special queries, @@ -159,7 +169,7 @@ public function loadByProperties(array $values = array()) { */ protected function buildQuery($ids, $revision_id = FALSE) { $config_class = $this->entityInfo['class']; - $prefix = $this->entityInfo['config_prefix'] . '.'; + $prefix = $this->getConfigPrefix(); // Load all of the configuration entities. if ($ids === NULL) { @@ -251,7 +261,7 @@ public function delete(array $entities) { } foreach ($entities as $id => $entity) { - $config = config($this->entityInfo['config_prefix'] . '.' . $entity->id()); + $config = config($this->getConfigPrefix() . $entity->id()); $config->delete(); // Remove the entity from the manifest file. @@ -273,7 +283,7 @@ public function delete(array $entities) { * When attempting to save a configuration entity that has no ID. */ public function save(EntityInterface $entity) { - $prefix = $this->entityInfo['config_prefix'] . '.'; + $prefix = $this->getConfigPrefix(); // Configuration entity IDs are strings, and '0' is a valid ID. $id = $entity->id();