summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Plugin/DataType/DynamicEntityReference.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Plugin/DataType/DynamicEntityReference.php b/src/Plugin/DataType/DynamicEntityReference.php
index 144bf26..249c662 100644
--- a/src/Plugin/DataType/DynamicEntityReference.php
+++ b/src/Plugin/DataType/DynamicEntityReference.php
@@ -50,7 +50,9 @@ class DynamicEntityReference extends EntityReference {
// DynamicEntityReferenceItem storage settings it is selected dynamically
// so it exists in DynamicEntityReferenceItem::values['target_type'].
$target_type = $this->parent->getValue()['target_type'];
- $entity = entity_load($target_type, $this->id);
+ $entity = \Drupal::entityTypeManager()
+ ->getStorage($target_type)
+ ->load($this->id);
$this->target = isset($entity) ? $entity->getTypedData() : NULL;
}
return $this->target;