function og_subgroups_views_handler_argument_parent::query in Subgroups for Organic groups 6
File
- modules/
og_subgroups_views/ includes/ og_subgroups_views_handler_argument_parent.inc, line 60
Class
Code
function query() {
$this
->ensure_my_table();
if (!empty($this->options['break_phrase'])) {
views_break_phrase($this->argument, $this);
}
else {
$this->value = array(
$this->argument,
);
}
$arguments = explode(',', $this->argument);
$placeholders = implode(', ', array_fill(0, sizeof($arguments), '%d'));
if ($this->options['include_parent']) {
$base_table = $this->query->base_table;
$base_field = $this->query->base_field;
foreach ($arguments as $arg) {
$arguments[] = $arg;
}
$this->query
->add_where(0, "{$this->table_alias}.{$this->real_field} IN ({$placeholders}) OR {$base_table}.{$base_field} IN ({$placeholders})", $arguments);
}
else {
$this->query
->add_where(0, "{$this->table_alias}.{$this->real_field} IN ({$placeholders})", $arguments);
}
}