function ExpressionManager::createRule

Creates a new rule.

Parameters

\Drupal\rules\Context\ContextConfig $configuration: (optional) The context configuration used to create the plugin instance.

Return value

\Drupal\rules\Engine\RuleExpressionInterface The created rule.

Overrides ExpressionManagerInterface::createRule

File

src/Engine/ExpressionManager.php, line 50

Class

ExpressionManager
Plugin manager for all Rules expressions.

Namespace

Drupal\rules\Engine

Code

public function createRule(ContextConfig $configuration = NULL) {
    $config_array = is_null($configuration) ? [] : $configuration->toArray();
    return $this->createInstance('rules_rule', $config_array);
}