You are here

function workflow_node_current_state in Workflow 8

Same name and namespace in other branches
  1. 5.2 workflow.module \workflow_node_current_state()
  2. 5 workflow.module \workflow_node_current_state()
  3. 6.2 workflow.module \workflow_node_current_state()
  4. 6 workflow.module \workflow_node_current_state()
  5. 7.2 workflow.module \workflow_node_current_state()
  6. 7 workflow.module \workflow_node_current_state()

Gets the current state ID of a given entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: An entity.

string $field_name: A Field name.

Return value

string The current State ID.

10 calls to workflow_node_current_state()
hook_form_workflow_transition_form_alter in ./workflow.api.php
Implements hook_form_BASE_FORM_ID_alter().
WorkflowDefaultWidget::formElement in src/Plugin/Field/FieldWidget/WorkflowDefaultWidget.php
Be careful: Widget may be shown in very different places. Test carefully!!
WorkflowItem::getSettableOptions in src/Plugin/Field/FieldType/WorkflowItem.php
Returns an array of settable values with labels for display.
WorkflowManager::executeScheduledTransitionsBetween in src/Entity/WorkflowManager.php
Given a time frame, execute all scheduled transitions.
WorkflowManager::getWorkflowTransitionForm in src/Entity/WorkflowManager.php
Gets the TransitionWidget in a form (for e.g., Workflow History Tab)

... See full list

File

./workflow.module, line 517
Support workflows made up of arbitrary states.

Code

function workflow_node_current_state(EntityInterface $entity, $field_name = '') {
  return WorkflowManager::getCurrentStateId($entity, $field_name);
}