Called to determine what to tell the clicksorter.
Overrides FieldPluginBase::clickSort
public function clickSort($order) {
// No column selected, can't continue.
if (empty($this->options['click_sort_column'])) {
return;
}
$this
->ensureMyTable();
$column = _field_sql_storage_columnname($this->definition['field_name'], $this->options['click_sort_column']);
if (!isset($this->aliases[$column])) {
// Column is not in query; add a sort on it (without adding the column).
$this->aliases[$column] = $this->tableAlias . '.' . $column;
}
$this->query
->addOrderBy(NULL, NULL, $order, $this->aliases[$column]);
}