function ConfigEntityType::getConfigPrefix

Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php \Drupal\Core\Config\Entity\ConfigEntityType::getConfigPrefix()
  2. 10 core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php \Drupal\Core\Config\Entity\ConfigEntityType::getConfigPrefix()
  3. 11.x core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php \Drupal\Core\Config\Entity\ConfigEntityType::getConfigPrefix()

Overrides ConfigEntityTypeInterface::getConfigPrefix

1 call to ConfigEntityType::getConfigPrefix()
ConfigEntityType::getPropertiesToExport in core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php
Gets the config entity properties to export if declared on the annotation.

File

core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php, line 78

Class

ConfigEntityType
Provides an implementation of a configuration entity type and its metadata.

Namespace

Drupal\Core\Config\Entity

Code

public function getConfigPrefix() {
    // Ensure that all configuration entities are prefixed by the name of the
    // module that provides the configuration entity type.
    if (isset($this->config_prefix)) {
        $config_prefix = $this->provider . '.' . $this->config_prefix;
    }
    else {
        $config_prefix = $this->provider . '.' . $this->id();
    }
    if (strlen($config_prefix) > static::PREFIX_LENGTH) {
        throw new ConfigPrefixLengthException("The configuration file name prefix {$config_prefix} exceeds the maximum character limit of " . static::PREFIX_LENGTH);
    }
    return $config_prefix;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.