You are here

function workflow_transition_load_single in Workflow 7.2

Load WorkflowTransitions, most recent first.

Return value

WorkflowTransition object representing one row from the {workflow_node_history} table.

7 calls to workflow_transition_load_single()
workflownode_tokens in workflow_node/workflownode.tokens.inc
Implements hook_tokens().
WorkflowTransitionController::save in includes/Entity/WorkflowTransition.php
Insert (no update) a transition.
workflow_get_recent_node_history in ./workflow.deprecated.inc
Get most recent transition for a node.
workflow_node_previous_state in ./workflow.module
Gets the previous state ID of a given entity.
_workflow_rules_node_check_previous_state in workflow_rules/workflow_rules.rules-callback.inc
Condition implementation: check previous state.

... See full list

File

./workflow.entity.inc, line 568
Integrates workflow with entity API.

Code

function workflow_transition_load_single($entity_type, $entity_id, $field_name = '', $langcode = '') {
  $limit = 1;
  if ($transitions = workflow_transition_load_multiple($entity_type, array(
    $entity_id,
  ), $field_name, $limit, $langcode)) {
    return reset($transitions);
  }
  return NULL;
}