function workflow_get_sid_name in Workflow 8
Helper function, to get the label of a given State Id. deprecated: workflow_get_sid_label() --> workflow_get_sid_name()
Parameters
string $sid: A State ID.
Return value
string An translated label.
2 calls to workflow_get_sid_name()
- WorkflowState::title in src/
Plugin/ views/ argument/ WorkflowState.php - Override the behavior of title().
- WorkflowStateActionBase::getTransitionForExecution in src/
Plugin/ Action/ WorkflowStateActionBase.php
File
- ./
workflow.module, line 445 - Support workflows made up of arbitrary states.
Code
function workflow_get_sid_name($sid) {
if (empty($sid)) {
$label = 'No state';
}
elseif ($state = WorkflowState::load($sid)) {
$label = $state
->label();
}
else {
$label = 'Unknown state';
}
return t($label);
}