You are here

function state_flow_entity_history_entity_label_get in State Machine 7.3

An Entity API Getter callback for the state_flow_history_entity state label.

This is the value used be the entity

1 string reference to 'state_flow_entity_history_entity_label_get'
state_flow_entity_entity_property_info in modules/state_flow_entity/state_flow_entity.module
Implements hook_entity_property_info().

File

modules/state_flow_entity/state_flow_entity.module, line 430
An implementation of entity workflow for Drupal based on the State Machine system.

Code

function state_flow_entity_history_entity_label_get($entity, array $options, $name, $entity_type, $info) {
  $return = '';
  if (!empty($entity->state)) {
    $state_labels = state_flow_entity_state_labels();
    if (!empty($state_labels[$entity->state])) {

      // @todo, check_plain might not be necessary as escaping could happen
      // later. Until I know otherwise, I'll stay on the safe side.
      $return = check_plain($state_labels[$entity->state]);
    }
  }
  return $return;
}