You are here

function state_flow_entity_entity_property_info in State Machine 7.3

Implements hook_entity_property_info().

See also

hook_entity_property_info()

1 call to state_flow_entity_entity_property_info()
StateFlowEntity::clean_history_entity in modules/state_flow_entity/plugins/state_flow_entity.inc
Removes all non Entity API properties from the history_entity.

File

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

Code

function state_flow_entity_entity_property_info() {
  $info = array();
  $info['state_flow_history_entity']['properties'] = array(
    'hid' => array(
      'type' => 'integer',
      'label' => 'History ID',
      'getter callback' => 'entity_property_verbatim_get',
      'sanitize' => 'filter_xss',
    ),
    // @todo, review what this state array should contain.
    'state' => array(
      'label' => 'State (machine name)',
      'getter callback' => 'entity_property_verbatim_get',
      'sanitize' => 'filter_xss',
    ),
    'from_state' => array(
      'label' => 'From State (machine name)',
      'getter callback' => 'entity_property_verbatim_get',
      'sanitize' => 'filter_xss',
    ),
    'state_label' => array(
      'label' => 'State Label',
      'getter callback' => 'state_flow_entity_history_entity_label_get',
      'sanitize' => 'filter_xss',
      'schema field' => 'uid',
    ),
    // @todo, all db column should be available as properties.
    'revision_id' => array(
      'type' => 'integer',
      'label' => 'Parent entity revision_id',
      'getter callback' => 'entity_property_verbatim_get',
      'sanitize' => 'filter_xss',
    ),
    'entity_type' => array(
      'type' => 'text',
      'label' => 'Parent entity_type',
      'getter callback' => 'entity_property_verbatim_get',
      'sanitize' => 'filter_xss',
    ),
    'timestamp' => array(
      'label' => t("Timestamp"),
      'type' => 'date',
      'description' => t("The date and time the history record was created"),
    ),
    'entity_id' => array(
      'type' => 'integer',
      'label' => 'Parent entity entity_id',
      'getter callback' => 'entity_property_verbatim_get',
      'sanitize' => 'filter_xss',
    ),
    'log' => array(
      'type' => 'text',
      'label' => 'State Flow log message',
      'getter callback' => 'entity_property_verbatim_get',
      'sanitize' => 'filter_xss',
    ),
    'user' => array(
      'label' => t("User"),
      'type' => 'user',
      'description' => t("The user who performed the state change"),
      'setter callback' => 'entity_property_verbatim_set',
      'schema field' => 'uid',
    ),
    'event' => array(
      'label' => t("Event"),
      'type' => 'text',
      'description' => t("The event that prompted this state change."),
      'sanitize' => 'filter_xss',
    ),
    'entity_revision' => array(
      'label' => t('Entity revision'),
      'type' => 'entity',
      'description' => t('The entity revision object.'),
    ),
  );
  return $info;
}