protected function EntityFetchById::doExecute in Rules 8.3
Executes the action with the given context.
Parameters
string $type: The entity type id.
int $entity_id: The entity id.
File
- src/
Plugin/ RulesAction/ EntityFetchById.php, line 93
Class
- EntityFetchById
- Provides a 'Fetch entity by id' action.
Namespace
Drupal\rules\Plugin\RulesActionCode
protected function doExecute($type, $entity_id) {
$storage = $this->entityTypeManager
->getStorage($type);
$entity = $storage
->load($entity_id);
$this
->setProvidedValue('entity_fetched', $entity);
}