You are here

public function ContextAwarePluginBase::getContextDefinitions in Plug 7

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

2 calls to ContextAwarePluginBase::getContextDefinitions()
ContextAwarePluginBase::getContexts in lib/Drupal/Component/Plugin/ContextAwarePluginBase.php
Gets the defined contexts.
ContextAwarePluginBase::getContextValues in lib/Drupal/Component/Plugin/ContextAwarePluginBase.php
Gets the values for all defined contexts.

File

lib/Drupal/Component/Plugin/ContextAwarePluginBase.php, line 73
Contains \Drupal\Component\Plugin\ContextAwarePluginBase.

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'] : array();
}