diff --git a/src/Entity/Flagging.php b/src/Entity/Flagging.php
index 1001b00..da83055 100644
--- a/src/Entity/Flagging.php
+++ b/src/Entity/Flagging.php
@@ -86,7 +86,9 @@ class Flagging extends ContentEntityBase implements FlaggingInterface {
    *   The flaggable entity.
    */
   public function getFlaggable() {
-    return $this->entityManager()->getStorage($this->getFlaggableType())->load($this->getFlaggableId());
+    $flggable_entity = $this->getFlaggableType();
+    $flaggable_id = $this->getFlaggableId();
+    return $this->entityManager()->getStorage($flggable_entity)->load($flaggable_id);
   }
 
   /**
