Oihana PHP Arango

FacetAggregator uses ConstantsTrait

The aggregator catalogue of the {@see \oihana\arango\models\enums\Facet::EDGE_AGGREGATE} and {@see \oihana\arango\models\enums\Facet::JOIN_AGGREGATE} facets.

Each short code maps to the AQL aggregation function that wraps the related sub-query, e.g. avg => AVERAGE(FOR … RETURN related.field). The count aggregator ignores the field and counts matched related documents (COUNT(FOR … RETURN 1)), generalizing the existential LENGTH(…) > 0.

Tags
since
1.0.0
author

Marc Alcaraz

Table of Contents

Constants

AVG  : string = 'avg'
COUNT  : string = 'count'
MAX  : string = 'max'
MIN  : string = 'min'
SUM  : string = 'sum'
__ALIAS__  : array<string|int, mixed> = [self::AVG => \oihana\arango\db\enums\functions...

Methods

getAlias()  : mixed
Returns the AQL aggregation function name for a short aggregator code.

Constants

__ALIAS__

protected array<string|int, mixed> __ALIAS__ = [self::AVG => \oihana\arango\db\enums\functions\NumericFunction::AVERAGE, self::COUNT => \oihana\arango\db\enums\functions\ArrayFunction::COUNT, self::MAX => \oihana\arango\db\enums\functions\NumericFunction::MAX, self::MIN => \oihana\arango\db\enums\functions\NumericFunction::MIN, self::SUM => \oihana\arango\db\enums\functions\NumericFunction::SUM]

Methods

getAlias()

Returns the AQL aggregation function name for a short aggregator code.

public static getAlias(mixed $value[, mixed $default = null ]) : mixed
Parameters
$value : mixed

The aggregator code (avg, sum, min, max, count).

$default : mixed = null

The value returned when the code is unknown (default null).

Return values
mixed

The AQL function name, or $default when unknown.

On this page

Search results