function RulesComponent::addContextDefinition

Adds a context definition.

Parameters

string $name: The name of the context to add.

\Drupal\rules\Context\ContextDefinitionInterface $definition: The definition to add.

Return value

$this

1 call to RulesComponent::addContextDefinition()
RulesComponent::addContextDefinitionsForEvents in src/Engine/RulesComponent.php
Adds the available event context for the given events.

File

src/Engine/RulesComponent.php, line 146

Class

RulesComponent
Handles executable Rules components.

Namespace

Drupal\rules\Engine

Code

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