function EntityCreate::refineContextDefinitions

Overrides RulesActionBase::refineContextDefinitions

File

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

Class

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

Namespace

Drupal\rules\Plugin\RulesAction

Code

public function refineContextDefinitions(array $selected_data) {
    if ($type = $this->entityTypeId) {
        $data_type = "entity:{$type}";
        if ($this->bundleKey && ($bundle = $this->getContextValue($this->bundleKey))) {
            $data_type .= ":{$bundle}";
        }
        $this->pluginDefinition['provides'][$type . '_created']
            ->setDataType($data_type);
    }
}