You are here

public function KanbanWorkflowService::getCurrentStateId in Content Planner 8

Gets the current State ID.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The entity to check.

Return value

mixed Returns the current moderation state id for the given entity.

2 calls to KanbanWorkflowService::getCurrentStateId()
KanbanWorkflowService::getCurrentStateLabel in modules/content_kanban/src/KanbanWorkflowService.php
Gets the label of the current state of a given entity.
KanbanWorkflowService::onEntityPresave in modules/content_kanban/src/KanbanWorkflowService.php
Acts upon a entity presave.

File

modules/content_kanban/src/KanbanWorkflowService.php, line 104

Class

KanbanWorkflowService
Class KanbanWorkflowService.

Namespace

Drupal\content_kanban

Code

public function getCurrentStateId(ContentEntityInterface $entity) {
  return $entity->moderation_state->value;
}