You are here

public function ExpressionManager::createAction in Rules 8.3

Creates a new action expression.

Parameters

string $id: The action plugin id.

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

Return value

\Drupal\rules\Engine\ActionExpressionInterface The created action expression.

Overrides ExpressionManagerInterface::createAction

File

src/Engine/ExpressionManager.php, line 66

Class

ExpressionManager
Plugin manager for all Rules expressions.

Namespace

Drupal\rules\Engine

Code

public function createAction($id, ContextConfig $configuration = NULL) {
  $config_array = is_null($configuration) ? [] : $configuration
    ->toArray();
  return $this
    ->createInstance('rules_action', [
    'action_id' => $id,
  ] + $config_array);
}