ConfigMapperManager::findDefinitions

protected ConfigMapperManager::findDefinitions()

Finds plugin definitions.

Return value

array List of definitions to store in cache.

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'], array('core', 'component')) && (!$this->moduleHandler->moduleExists($plugin_definition['provider']) && !in_array($plugin_definition['provider'], array_keys($this->themeHandler->listInfo())))) {
      unset($definitions[$plugin_id]);
    }
  }
  return $definitions;
}
doc_Drupal
2016-10-29 08:54:11
Comments
Leave a Comment

Please login to continue.