You are here

public function ConditionPluginCollection::addContext in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Condition/ConditionPluginCollection.php \Drupal\Core\Condition\ConditionPluginCollection::addContext()

Sets the condition context for a given name.

Parameters

string $name: The name of the context.

\Drupal\Component\Plugin\Context\ContextInterface $context: The context to add.

Return value

$this

File

core/lib/Drupal/Core/Condition/ConditionPluginCollection.php, line 62

Class

ConditionPluginCollection
Provides a collection of condition plugins.

Namespace

Drupal\Core\Condition

Code

public function addContext($name, ContextInterface $context) {
  $this->conditionContexts[$name] = $context;
  return $this;
}