Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Sql.php

function Sql::addGroupBy

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 Sql::addGroupBy()
Sql::query in core/modules/views/src/Plugin/views/query/Sql.php
Generates a query and count query from all of the information supplied.

File

core/modules/views/src/Plugin/views/query/Sql.php, line 1104

Class

Sql
Views query plugin for an SQL query.

Namespace

Drupal\views\Plugin\views\query

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal