You are here

public function RuleExpression::addCondition in Rules 8.3

Creates a condition expression and adds it to the container.

Parameters

string $condition_id: The condition plugin id.

\Drupal\rules\Context\ContextConfig $config: (optional) The configuration for the specified plugin.

Return value

\Drupal\rules\Core\RulesConditionInterface The created condition.

Overrides RuleExpressionInterface::addCondition

File

src/Plugin/RulesExpression/RuleExpression.php, line 132

Class

RuleExpression
Provides a rule, executing actions when conditions are met.

Namespace

Drupal\rules\Plugin\RulesExpression

Code

public function addCondition($condition_id, ContextConfig $config = NULL) {
  return $this->conditions
    ->addCondition($condition_id, $config);
}