function QueryBase::getAggregationAlias

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

Generates an alias for a field and its aggregated function.

Parameters

string $field: The field name used in the alias.

string $function: The aggregation function used in the alias.

Return value

string The alias for the field.

2 calls to QueryBase::getAggregationAlias()
QueryBase::aggregate in core/lib/Drupal/Core/Entity/Query/QueryBase.php
QueryBase::sortAggregate in core/lib/Drupal/Core/Entity/Query/QueryBase.php

File

core/lib/Drupal/Core/Entity/Query/QueryBase.php, line 463

Class

QueryBase
The base entity query class.

Namespace

Drupal\Core\Entity\Query

Code

protected function getAggregationAlias($field, $function) {
    return strtolower($field . '_' . $function);
}

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