function views_handler_filter_block_cache::query in Views Hacks 6
Same name and namespace in other branches
- 7 views_block/handlers/views_handler_filter_block_cache.inc \views_handler_filter_block_cache::query()
File
- views_block/
handlers/ views_handler_filter_block_cache.inc, line 30
Class
- views_handler_filter_block_cache
- Filter based on block cache settings.
Code
function query() {
$this
->ensure_my_table();
if (in_array(BLOCK_NO_CACHE, $this->value)) {
$this->query
->add_where($this->options['group'], "{$this->table_alias}.{$this->real_field} = %d", BLOCK_NO_CACHE);
}
else {
$val = 0;
if (!empty($this->value)) {
foreach ($this->value as $bit) {
$val |= $bit;
}
}
$this->query
->add_where($this->options['group'], "{$this->table_alias}.{$this->real_field} & %d = %d", $val, $val);
$this->query
->add_where($this->options['group'], "{$this->table_alias}.{$this->real_field} != %d", BLOCK_NO_CACHE);
}
}