Dec 01, 2020 in Drupal 8

Worfklows are a powerful tool to add events and states to your entities. Here's how to get the current state programmatically:

// Make sure the entity is an object
$entity->get('moderation_state')->getString();