You are here

public function EntityCreate::execute in Rules 8.3

Executes the plugin.

Overrides RulesActionBase::execute

File

src/Plugin/RulesAction/EntityCreate.php, line 92

Class

EntityCreate
Provides a generic 'Create a new entity' action.

Namespace

Drupal\rules\Plugin\RulesAction

Code

public function execute() {
  $values = $this
    ->getContextValues();
  $entity = $this->storage
    ->create($values);
  $this
    ->setProvidedValue($this->entityTypeId . '_created', $entity);
}