function state_flow_query_node_revision_alter in State Machine 7.3
Same name and namespace in other branches
- 7.2 modules/state_flow/state_flow.module \state_flow_query_node_revision_alter()
Implements hook_query_node_revision_alter()
File
- modules/
state_flow/ state_flow.module, line 515 - An implementation of node revision workflow for Drupal based on the State Machine system.
Code
function state_flow_query_node_revision_alter(QueryAlterableInterface $query) {
// Get the filter form the session
$filters = $query
->getMetaData('filters');
if ($filter = isset($filters['state']) ? $filters['state'] : NULL) {
$query
->join('state_flow_states', 'sfs', 'nr.vid = sfs.revision_id AND entity_type=\'node\'');
$query
->condition('sfs.state', $filter);
}
}