You are here

protected function TypedConfigManager::determineType in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Config/TypedConfigManager.php \Drupal\Core\Config\TypedConfigManager::determineType()
  2. 9 core/lib/Drupal/Core/Config/TypedConfigManager.php \Drupal\Core\Config\TypedConfigManager::determineType()

Determines the typed config type for a plugin ID.

Parameters

string $base_plugin_id: The plugin ID.

array $definitions: An array of typed config definitions.

Return value

string The typed config type for the given plugin ID.

1 call to TypedConfigManager::determineType()
TypedConfigManager::getDefinitionWithReplacements in core/lib/Drupal/Core/Config/TypedConfigManager.php
Gets a schema definition with replacements for dynamic names.

File

core/lib/Drupal/Core/Config/TypedConfigManager.php, line 129

Class

TypedConfigManager
Manages config schema type plugins.

Namespace

Drupal\Core\Config

Code

protected function determineType($base_plugin_id, array $definitions) {
  if (isset($definitions[$base_plugin_id])) {
    $type = $base_plugin_id;
  }
  elseif (strpos($base_plugin_id, '.') && ($name = $this
    ->getFallbackName($base_plugin_id))) {

    // Found a generic name, replacing the last element by '*'.
    $type = $name;
  }
  else {

    // If we don't have definition, return the 'undefined' element.
    $type = 'undefined';
  }
  return $type;
}