You are here

function workflow_search_api_property_workflow_state_getter_callback in Workflow 7

Same name and namespace in other branches
  1. 7.2 workflow_search_api/workflow_search_api.module \workflow_search_api_property_workflow_state_getter_callback()

Getter callback for workflow state defined in workflow_search_api_entity_property_info_alter.

1 string reference to 'workflow_search_api_property_workflow_state_getter_callback'
workflow_search_api_entity_property_info_alter in workflow_search_api/workflow_search_api.module
Implements hook_entity_property_info_alter().

File

workflow_search_api/workflow_search_api.module, line 22
Adds workflow state information to Search API index.

Code

function workflow_search_api_property_workflow_state_getter_callback($item) {
  $state_name = '';
  if ($sid = $item->workflow) {

    // Get text value of workflow state.
    $state = WorkflowState::load($sid);
    $state_name = $state
      ->getName();
  }
  return $state_name;
}