Called to add the field to a query.
Overrides PluginBase::query
public function query() {
$this
->ensureMyTable();
// Add the field.
$params = $this->options['group_type'] != 'group' ? array(
'function' => $this->options['group_type'],
) : array();
$this->field_alias = $this->query
->addField($this->tableAlias, $this->realField, NULL, $params);
$this
->addAdditionalFields();
}