function ContextAwarePluginDefinitionTrait::getContextDefinition

Same name in other branches
  1. 9 core/lib/Drupal/Component/Plugin/Definition/ContextAwarePluginDefinitionTrait.php \Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionTrait::getContextDefinition()
  2. 10 core/lib/Drupal/Component/Plugin/Definition/ContextAwarePluginDefinitionTrait.php \Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionTrait::getContextDefinition()
  3. 11.x core/lib/Drupal/Component/Plugin/Definition/ContextAwarePluginDefinitionTrait.php \Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionTrait::getContextDefinition()

Implements \Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionInterface::getContextDefinition().

File

core/lib/Drupal/Component/Plugin/Definition/ContextAwarePluginDefinitionTrait.php, line 37

Class

ContextAwarePluginDefinitionTrait
Provides a trait for context-aware object-based plugin definitions.

Namespace

Drupal\Component\Plugin\Definition

Code

public function getContextDefinition($name) {
    if ($this->hasContextDefinition($name)) {
        return $this->contextDefinitions[$name];
    }
    throw new ContextException($this->id() . " does not define a '{$name}' context");
}

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