function state_flow_query_node_revision_alter in State Machine 7.2
Same name and namespace in other branches
- 7.3 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 628 - 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('node_revision_states', 'nrs', 'nr.vid = nrs.vid');
$query
->condition('nrs.state', $filter);
}
}