function ConfigMapperManager::findDefinitions

Same name in other branches
  1. 9 core/modules/config_translation/src/ConfigMapperManager.php \Drupal\config_translation\ConfigMapperManager::findDefinitions()
  2. 10 core/modules/config_translation/src/ConfigMapperManager.php \Drupal\config_translation\ConfigMapperManager::findDefinitions()
  3. 11.x core/modules/config_translation/src/ConfigMapperManager.php \Drupal\config_translation\ConfigMapperManager::findDefinitions()

Overrides DefaultPluginManager::findDefinitions

File

core/modules/config_translation/src/ConfigMapperManager.php, line 146

Class

ConfigMapperManager
Manages plugins for configuration translation mappers.

Namespace

Drupal\config_translation

Code

protected function findDefinitions() {
    $definitions = $this->getDiscovery()
        ->getDefinitions();
    foreach ($definitions as $plugin_id => &$definition) {
        $this->processDefinition($definition, $plugin_id);
    }
    if ($this->alterHook) {
        $this->moduleHandler
            ->alter($this->alterHook, $definitions);
    }
    // If this plugin was provided by a module that does not exist, remove the
    // plugin definition.
    foreach ($definitions as $plugin_id => $plugin_definition) {
        if (isset($plugin_definition['provider']) && !in_array($plugin_definition['provider'], [
            'core',
            'component',
        ]) && (!$this->moduleHandler
            ->moduleExists($plugin_definition['provider']) && !in_array($plugin_definition['provider'], array_keys($this->themeHandler
            ->listInfo())))) {
            unset($definitions[$plugin_id]);
        }
    }
    return $definitions;
}

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