function config_get_entity_type_by_name

Returns the entity type of a configuration object.

Parameters

string $name: The configuration object name.

Return value

string|null Either the entity type name, or NULL if none match.

1 call to config_get_entity_type_by_name()
ConfigImporter::importInvokeOwner in drupal/core/lib/Drupal/Core/Config/ConfigImporter.php
Invokes import* methods on configuration entity storage controllers.

File

drupal/core/includes/config.inc, line 164
This is the API for configuration storage.

Code

function config_get_entity_type_by_name($name) {
  $entities = array_filter(entity_get_info(), function ($entity_info) use ($name) {
    return isset($entity_info['config_prefix']) && strpos($name, $entity_info['config_prefix'] . '.') === 0;
  });
  return key($entities);
}