Set up the query for this argument.
The argument sent may be found at $this->argument.
Overrides ArgumentPluginBase::query
public function query($group_by = FALSE) {
$this
->ensureMyTable();
if (!empty($this->options['break_phrase'])) {
$this
->breakPhrase($this->argument, $this);
}
else {
$this->value = array(
$this->argument,
);
}
$placeholder = $this
->placeholder();
$null_check = empty($this->options['not']) ? '' : "OR {$this->tableAlias}.{$this->realField} IS NULL";
if (count($this->value) > 1) {
$operator = empty($this->options['not']) ? 'IN' : 'NOT IN';
$this->query
->add_where_expression(0, "{$this->tableAlias}.{$this->realField} {$operator}({$placeholder}) {$null_check}", array(
$placeholder => $this->value,
));
}
else {
$operator = empty($this->options['not']) ? '=' : '!=';
$this->query
->add_where_expression(0, "{$this->tableAlias}.{$this->realField} {$operator} {$placeholder} {$null_check}", array(
$placeholder => $this->argument,
));
}
}