protected function ContextHandler::getContextDefinitions in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Plugin/Context/ContextHandler.php \Drupal\Core\Plugin\Context\ContextHandler::getContextDefinitions()
Returns the context definitions associated with a plugin definition.
Parameters
array|\Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionInterface $plugin_definition: The plugin definition.
Return value
\Drupal\Component\Plugin\Context\ContextDefinitionInterface[]|null The context definitions, or NULL if the plugin definition does not support contexts.
1 call to ContextHandler::getContextDefinitions()
- ContextHandler::filterPluginDefinitionsByContexts in core/
lib/ Drupal/ Core/ Plugin/ Context/ ContextHandler.php - Determines plugins whose constraints are satisfied by a set of contexts.
File
- core/
lib/ Drupal/ Core/ Plugin/ Context/ ContextHandler.php, line 50
Class
- ContextHandler
- Provides methods to handle sets of contexts.
Namespace
Drupal\Core\Plugin\ContextCode
protected function getContextDefinitions($plugin_definition) {
if ($plugin_definition instanceof ContextAwarePluginDefinitionInterface) {
return $plugin_definition
->getContextDefinitions();
}
if (is_array($plugin_definition) && isset($plugin_definition['context_definitions'])) {
return $plugin_definition['context_definitions'];
}
return NULL;
}