You are here

public function ConditionAggregateBase::condition in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/Query/ConditionAggregateBase.php \Drupal\Core\Entity\Query\ConditionAggregateBase::condition()

Adds a condition.

Parameters

string|ConditionAggregateInterface $field:

string $function:

mixed $value:

string $operator:

string $langcode:

Return value

$this The called object.

Overrides ConditionAggregateInterface::condition

See also

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

2 calls to ConditionAggregateBase::condition()
ConditionAggregate::exists in core/lib/Drupal/Core/Entity/Query/Sql/ConditionAggregate.php
Queries for the existence of a field.
ConditionAggregate::notExists in core/lib/Drupal/Core/Entity/Query/Sql/ConditionAggregate.php
Queries for the nonexistence of a field.

File

core/lib/Drupal/Core/Entity/Query/ConditionAggregateBase.php, line 13

Class

ConditionAggregateBase
Defines a common base class for all aggregation entity condition implementations.

Namespace

Drupal\Core\Entity\Query

Code

public function condition($field, $function = NULL, $value = NULL, $operator = NULL, $langcode = NULL) {
  $this->conditions[] = [
    'field' => $field,
    'function' => $function,
    'value' => $value,
    'operator' => $operator,
    'langcode' => $langcode,
  ];
  return $this;
}