You are here

public function Flagging::getFlaggable in Flag 8.4

Returns the flaggable entity.

Return value

\Drupal\Core\Entity\EntityInterface The entity object.

Overrides FlaggingInterface::getFlaggable

File

src/Entity/Flagging.php, line 100

Class

Flagging
Provides the flagging content entity.

Namespace

Drupal\flag\Entity

Code

public function getFlaggable() {
  $flaggable_type = $this
    ->getFlaggableType();
  $flaggable_id = $this
    ->getFlaggableId();
  return $this
    ->entityTypeManager()
    ->getStorage($flaggable_type)
    ->load($flaggable_id);
}