function DefaultPluginManager::findDefinitions

Same name in other branches
  1. 9 core/lib/Drupal/Core/Plugin/DefaultPluginManager.php \Drupal\Core\Plugin\DefaultPluginManager::findDefinitions()
  2. 8.9.x core/lib/Drupal/Core/Plugin/DefaultPluginManager.php \Drupal\Core\Plugin\DefaultPluginManager::findDefinitions()
  3. 10 core/lib/Drupal/Core/Plugin/DefaultPluginManager.php \Drupal\Core\Plugin\DefaultPluginManager::findDefinitions()

Finds plugin definitions.

Return value

array List of definitions to store in cache.

1 call to DefaultPluginManager::findDefinitions()
DefaultPluginManager::getDefinitions in core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
Gets the definition of all plugins for this type.
7 methods override DefaultPluginManager::findDefinitions()
ConfigMapperManager::findDefinitions in core/modules/config_translation/src/ConfigMapperManager.php
Finds plugin definitions.
EntityTypeManager::findDefinitions in core/lib/Drupal/Core/Entity/EntityTypeManager.php
Finds plugin definitions.
HelpTopicPluginManager::findDefinitions in core/modules/help/src/HelpTopicPluginManager.php
Finds plugin definitions.
MigrateFieldPluginManager::findDefinitions in core/modules/migrate_drupal/src/Plugin/MigrateFieldPluginManager.php
Finds plugin definitions.
MigrateSourcePluginManager::findDefinitions in core/modules/migrate/src/Plugin/MigrateSourcePluginManager.php
Finds plugin definitions.

... See full list

File

core/lib/Drupal/Core/Plugin/DefaultPluginManager.php, line 336

Class

DefaultPluginManager
Base class for plugin managers.

Namespace

Drupal\Core\Plugin

Code

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

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