function workflow_node_current_state in Workflow 8
Same name and namespace in other branches
- 5.2 workflow.module \workflow_node_current_state()
- 5 workflow.module \workflow_node_current_state()
- 6.2 workflow.module \workflow_node_current_state()
- 6 workflow.module \workflow_node_current_state()
- 7.2 workflow.module \workflow_node_current_state()
- 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)
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);
}