Called to add the field to a query.
Overrides SortPluginBase::query
public function query() {
$this
->ensureMyTable();
$params = array(
'function' => $this->options['group_type'],
);
$this->query
->add_orderby($this->tableAlias, $this->realField, $this->options['order'], NULL, $params);
}