You are here

public function ContextAwarePluginDefinitionTrait::addContextDefinition in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Plugin/Definition/ContextAwarePluginDefinitionTrait.php \Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionTrait::addContextDefinition()
  2. 9 core/lib/Drupal/Component/Plugin/Definition/ContextAwarePluginDefinitionTrait.php \Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionTrait::addContextDefinition()

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

2 calls to ContextAwarePluginDefinitionTrait::addContextDefinition()
LayoutDefinition::__construct in core/lib/Drupal/Core/Layout/LayoutDefinition.php
LayoutDefinition constructor.
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;
}