function QueryAggregateInterface::aggregate

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Query/QueryAggregateInterface.php \Drupal\Core\Entity\Query\QueryAggregateInterface::aggregate()
  2. 10 core/lib/Drupal/Core/Entity/Query/QueryAggregateInterface.php \Drupal\Core\Entity\Query\QueryAggregateInterface::aggregate()
  3. 11.x core/lib/Drupal/Core/Entity/Query/QueryAggregateInterface.php \Drupal\Core\Entity\Query\QueryAggregateInterface::aggregate()

Specifies a field and a function to aggregate on.

Available functions: SUM, AVG, MIN, MAX and COUNT.

@todo What about GROUP_CONCAT support?

Parameters

string $field: The name of the field to aggregate by.

string $function: The aggregation function, for example COUNT or MIN.

string $langcode: (optional) The language code.

string $alias: (optional) The key that will be used on the resultset.

Return value

$this The called object.

File

core/lib/Drupal/Core/Entity/Query/QueryAggregateInterface.php, line 29

Class

QueryAggregateInterface
Defines a interface for aggregated entity queries.

Namespace

Drupal\Core\Entity\Query

Code

public function aggregate($field, $function, $langcode = NULL, &$alias = NULL);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.