function DefaultPluginManager::alterDefinitions

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

Invokes the hook to alter the definitions if the alter hook is set.

Parameters

$definitions: The discovered plugin definitions.

8 calls to DefaultPluginManager::alterDefinitions()
ComponentPluginManager::alterDefinitions in core/lib/Drupal/Core/Theme/ComponentPluginManager.php
ConfigActionManager::alterDefinitions in core/lib/Drupal/Core/Config/Action/ConfigActionManager.php
DefaultPluginManager::findDefinitions in core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
Finds plugin definitions.
EntityTypeManager::findDefinitions in core/lib/Drupal/Core/Entity/EntityTypeManager.php
FieldTypeCategoryManager::alterDefinitions in core/lib/Drupal/Core/Field/FieldTypeCategoryManager.php

... See full list

5 methods override DefaultPluginManager::alterDefinitions()
ComponentPluginManager::alterDefinitions in core/lib/Drupal/Core/Theme/ComponentPluginManager.php
ComponentPluginManager::alterDefinitions in core/modules/sdc/src/ComponentPluginManager.php
Invokes the hook to alter the definitions if the alter hook is set.
ConfigActionManager::alterDefinitions in core/lib/Drupal/Core/Config/Action/ConfigActionManager.php
FieldTypeCategoryManager::alterDefinitions in core/lib/Drupal/Core/Field/FieldTypeCategoryManager.php
TypedConfigManager::alterDefinitions in core/lib/Drupal/Core/Config/TypedConfigManager.php

File

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

Class

DefaultPluginManager
Base class for plugin managers.

Namespace

Drupal\Core\Plugin

Code

protected function alterDefinitions(&$definitions) {
    if ($this->alterHook) {
        $this->moduleHandler
            ->alter($this->alterHook, $definitions);
    }
}

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