W3cubDocs

/Drupal 8

protected function 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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!TypedConfigManager.php/function/TypedConfigManager::determineType/8.1.x