You are here

public function views_plugin_query_default::add_groupby in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 plugins/views_plugin_query_default.inc \views_plugin_query_default::add_groupby()

Add a simple GROUP BY clause to the query.

The caller is responsible for ensuring that the fields are fully qualified and the table is properly added.

1 call to views_plugin_query_default::add_groupby()
views_plugin_query_default::query in plugins/views_plugin_query_default.inc
Generate a query and a countquery from all of the information supplied to the object.

File

plugins/views_plugin_query_default.inc, line 1088
Definition of views_plugin_query_default.

Class

views_plugin_query_default
Object used to create a SELECT query.

Code

public function add_groupby($clause) {

  // Only add it if it's not already in there.
  if (!in_array($clause, $this->groupby)) {
    $this->groupby[] = $clause;
  }
}