TypedConfigManager::determineType

protected TypedConfigManager::determineType($base_plugin_id, array $definitions)

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.

File

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

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;
}
doc_Drupal
2016-10-29 09:49:54
Comments
Leave a Comment

Please login to continue.