function flag_handler_relationship_counts::query in Flag 7.2
Same name and namespace in other branches
- 6.2 includes/flag_handler_relationships.inc \flag_handler_relationship_counts::query()
- 6 includes/flag_handler_relationships.inc \flag_handler_relationship_counts::query()
- 7.3 includes/views/flag_handler_relationships.inc \flag_handler_relationship_counts::query()
Called to implement a relationship in a query.
Overrides views_handler_relationship::query
File
- includes/
flag_handler_relationships.inc, line 201 - Contains various relationship handlers.
Class
- flag_handler_relationship_counts
- Specialized relationship handler associating flag counts and content.
Code
function query() {
if (!($flag = $this
->get_flag())) {
return;
}
$this->definition['extra'][] = array(
'field' => 'fid',
'value' => $flag->fid,
'numeric' => TRUE,
);
if (!empty($this->options['required'])) {
// Unfortunately, we may have zeros in our table, so having
// parent::query() do INNER JOIN doesn't suffice. We need to filter these
// zeros out.
// @todo Make sure zero records aren't written in the first place, and
// remove this code.
$this->definition['extra'][] = array(
'field' => 'count',
'operator' => '>',
'value' => '0',
'numeric' => TRUE,
);
}
parent::query();
}