function ContextAwarePluginDefinitionTrait::addContextDefinition

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

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

1 call to ContextAwarePluginDefinitionTrait::addContextDefinition()
SectionStorageDefinition::__construct in core/modules/layout_builder/src/SectionStorage/SectionStorageDefinition.php
LayoutDefinition constructor.

File

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

Class

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

Namespace

Drupal\Component\Plugin\Definition

Code

public function addContextDefinition($name, ContextDefinitionInterface $definition) {
    $this->contextDefinitions[$name] = $definition;
    return $this;
}

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