function EntityCreate::execute

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);
}