function ConfigManager::loadConfigEntityByName

Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/ConfigManager.php \Drupal\Core\Config\ConfigManager::loadConfigEntityByName()
  2. 8.9.x core/lib/Drupal/Core/Config/ConfigManager.php \Drupal\Core\Config\ConfigManager::loadConfigEntityByName()
  3. 11.x core/lib/Drupal/Core/Config/ConfigManager.php \Drupal\Core\Config\ConfigManager::loadConfigEntityByName()
1 call to ConfigManager::loadConfigEntityByName()
ConfigManager::callOnDependencyRemoval in core/lib/Drupal/Core/Config/ConfigManager.php
Calls an entity's onDependencyRemoval() method.

File

core/lib/Drupal/Core/Config/ConfigManager.php, line 134

Class

ConfigManager
The ConfigManager provides helper functions for the configuration system.

Namespace

Drupal\Core\Config

Code

public function loadConfigEntityByName($name) {
    $entity_type_id = $this->getEntityTypeIdByName($name);
    if ($entity_type_id) {
        $entity_type = $this->entityTypeManager
            ->getDefinition($entity_type_id);
        $id = substr($name, strlen($entity_type->getConfigPrefix()) + 1);
        return $this->entityTypeManager
            ->getStorage($entity_type_id)
            ->load($id);
    }
    return NULL;
}

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