public function ContextAwarePluginTrait::getContextDefinitions in Drupal 10
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php \Drupal\Core\Plugin\ContextAwarePluginTrait::getContextDefinitions()
Return value
\Drupal\Core\Plugin\Context\ContextDefinitionInterface[]
File
- core/
lib/ Drupal/ Core/ Plugin/ ContextAwarePluginTrait.php, line 126
Class
- ContextAwarePluginTrait
- Provides a trait to add context-aware functionality to plugins.
Namespace
Drupal\Core\PluginCode
public function getContextDefinitions() {
$definition = $this
->getPluginDefinition();
if ($definition instanceof ContextAwarePluginDefinitionInterface) {
return $definition
->getContextDefinitions();
}
return !empty($definition['context_definitions']) ? $definition['context_definitions'] : [];
}