8.5.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()
8.5.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()
8.0.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()
8.0.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()
8.1.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()
8.1.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()
8.2.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()
8.2.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()
8.3.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()
8.3.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()
8.4.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()
8.4.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()
8.6.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()
8.6.x ContextAwarePluginBase.php ContextAwarePluginBase::getContextDefinitions()

Gets the context definitions of the plugin.

Return value

\Drupal\Component\Plugin\Context\ContextDefinitionInterface[] The array of context definitions, keyed by context name.

Overrides ContextAwarePluginInterface::getContextDefinitions

1 method overrides ContextAwarePluginBase::getContextDefinitions()

File

core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php, line 68

Class

ContextAwarePluginBase
Base class for plugins that are context aware.

Namespace

Drupal\Component\Plugin

Code

public function getContextDefinitions() {
  $definition = $this
    ->getPluginDefinition();
  return !empty($definition['context']) ? $definition['context'] : [];
}