function TypedConfigManager::findFallback

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Config/TypedConfigManager.php \Drupal\Core\Config\TypedConfigManager::findFallback()

Finds fallback configuration schema name.

Parameters

string $name: Configuration name or key.

Return value

null|string The resolved schema name for the given configuration name or key. Returns null if there is no schema name to fallback to. For example, breakpoint.breakpoint.module.toolbar.narrow will check for definitions in the following order: breakpoint.breakpoint.module.toolbar.* breakpoint.breakpoint.module.*.* breakpoint.breakpoint.module.* breakpoint.breakpoint.*.*.* breakpoint.breakpoint.* breakpoint.*.*.*.* breakpoint.* Colons are also used, for example, block.settings.system_menu_block:footer will check for definitions in the following order: block.settings.system_menu_block:* block.settings.*:* block.settings.* block.*.*:* block.*

File

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

Class

TypedConfigManager
Manages config schema type plugins.

Namespace

Drupal\Core\Config

Code

public function findFallback(string $name) : ?string {
    $fallback = $this->getFallbackName($name);
    assert($fallback === NULL || str_ends_with($fallback, '.*'));
    return $fallback;
}

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