abstract class ConditionAggregateBase extends ConditionFundamentals implements ConditionAggregateInterface (View source)

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

Properties

protected array $conditions

Array of conditions.

from  ConditionFundamentals
protected string $conjunction

The conjunction of this condition group.

from  ConditionFundamentals
protected QueryInterface $query

The query this condition belongs to.

from  ConditionFundamentals
protected array $namespaces

List of potential namespaces of the classes belonging to this condition.

from  ConditionFundamentals

Methods

__construct(string $conjunction, QueryInterface $query, array $namespaces = [])

Constructs a Condition object.

getConjunction()

{@inheritdoc}

count()

{@inheritdoc}

conditions()

{@inheritdoc}

__clone()

Implements the magic __clone function.

$this
condition(string|ConditionAggregateInterface $field, string $function = NULL, mixed $value = NULL, string $operator = NULL, string $langcode = NULL)

Adds a condition.

Details

__construct(string $conjunction, QueryInterface $query, array $namespaces = [])

Constructs a Condition object.

Parameters

string $conjunction

The operator to use to combine conditions: 'AND' or 'OR'.

QueryInterface $query

The entity query this condition belongs to.

array $namespaces

List of potential namespaces of the classes belonging to this condition.

getConjunction()

{@inheritdoc}

count()

{@inheritdoc}

conditions()

{@inheritdoc}

__clone()

Implements the magic __clone function.

Makes sure condition groups are cloned as well.

$this condition(string|ConditionAggregateInterface $field, string $function = NULL, mixed $value = NULL, string $operator = NULL, string $langcode = NULL)

Adds a condition.

Parameters

string|ConditionAggregateInterface $field

The field.

string $function

(optional) The function.

mixed $value

(optional) The value.

string $operator

(optional) The operator.

string $langcode

(optional) For which language the entity should be prepared, defaults to the current content language.

Return Value

$this

The called object.