function ActionExpressionContainer::addAction

Creates an action expression and adds it to the container.

Parameters

string $action_id: The action plugin id.

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

Return value

$this

Overrides ActionExpressionContainerInterface::addAction

File

src/Engine/ActionExpressionContainer.php, line 66

Class

ActionExpressionContainer
Container for actions.

Namespace

Drupal\rules\Engine

Code

public function addAction($action_id, ContextConfig $config = NULL) {
    return $this->addExpressionObject($this->expressionManager
        ->createAction($action_id)
        ->setConfiguration($config ? $config->toArray() : []));
}