function ContextAwarePluginManagerTrait::getDefinitionsForContexts

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerTrait.php \Drupal\Core\Plugin\Context\ContextAwarePluginManagerTrait::getDefinitionsForContexts()
  2. 10 core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerTrait.php \Drupal\Core\Plugin\Context\ContextAwarePluginManagerTrait::getDefinitionsForContexts()
  3. 8.9.x core/lib/Drupal/Core/Plugin/Context/ContextAwarePluginManagerTrait.php \Drupal\Core\Plugin\Context\ContextAwarePluginManagerTrait::getDefinitionsForContexts()

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

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());
}

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