function QueryAggregateInterface::conditionAggregate

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

Sets a condition for an aggregated value.

Parameters

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

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

mixed $value: The actual value of the field.

$operator: Possible values:

  • '=', '<>', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS', 'ENDS_WITH': These operators expect $value to be a literal of the same type as the column.
  • 'IN', 'NOT IN': These operators expect $value to be an array of literals of the same type as the column.
  • 'BETWEEN', 'NOT BETWEEN': These operators expect $value to be an array of two literals of the same type as the column.

string $langcode: (optional) The language code.

Return value

$this The called object.

See also

\Drupal\Core\Entity\Query\QueryInterface::condition()

File

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

Class

QueryAggregateInterface
Defines an interface for aggregated entity queries.

Namespace

Drupal\Core\Entity\Query

Code

public function conditionAggregate($field, $function = NULL, $value = NULL, $operator = '=', $langcode = NULL);

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