You are here

public function ContextAwarePluginManagerTrait::getDefinitionsForContexts in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerTrait.php \Drupal\Core\Plugin\Context\ContextAwarePluginManagerTrait::getDefinitionsForContexts()
  2. 9 core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerTrait.php \Drupal\Core\Plugin\Context\ContextAwarePluginManagerTrait::getDefinitionsForContexts()

See \Drupal\Core\Plugin\Context\ContextAwarePluginManagerInterface::getDefinitionsForContexts().

1 call to ContextAwarePluginManagerTrait::getDefinitionsForContexts()
FilteredPluginManagerTrait::getFilteredDefinitions in core/lib/Drupal/Core/Plugin/FilteredPluginManagerTrait.php
Implements \Drupal\Core\Plugin\FilteredPluginManagerInterface::getFilteredDefinitions().

File

core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerTrait.php, line 22

Class

ContextAwarePluginManagerTrait
Provides a trait for plugin managers that support context-aware plugins.

Namespace

Drupal\Core\Plugin\Context

Code

public function getDefinitionsForContexts(array $contexts = []) {
  return $this
    ->contextHandler()
    ->filterPluginDefinitionsByContexts($contexts, $this
    ->getDefinitions());
}