function flag_query_handler_ops in Flag 5
This handler loads the type of the node so the display handler, above, can determine if the flag applies to it.
1 string reference to 'flag_query_handler_ops'
- flag_views_tables in includes/
flag.views.inc - Implementation of hook_views_tables
File
- includes/
flag.views.inc, line 226 - Provides support for the Views module.
Code
function flag_query_handler_ops($field, $fieldinfo, &$query) {
$fid = $fieldinfo['fid'];
$flag = flag_get_flag(NULL, $fid);
// Load the type of the node.
// I could simply do $query->add_field('type', 'node', 'type') and get
// rid of this pseudo table, defined in hook_views_tables(), but I suspect
// that it will be easier to port to Views 2 if we don't hardcode the 'node'.
$query
->add_field('type', 'flag_types_' . $flag->name, 'flag_types_' . $flag->name . '_type');
}