private function hydrateResult( Aggregation
$aggregation,
EntityDefinition
$definition,
array
$rows,
Context
$context ): AggregationResult
{ $name =
$aggregation->
getName();
switch (true
) { case $aggregation instanceof DateHistogramAggregation:
return $this->
hydrateDateHistogramAggregation($aggregation,
$definition,
$rows,
$context);
case $aggregation instanceof TermsAggregation:
return $this->
hydrateTermsAggregation($aggregation,
$definition,
$rows,
$context);
case $aggregation instanceof FilterAggregation:
$aggregationStruct =
$aggregation->
getAggregation();
\
assert($aggregationStruct !== null, 'FilterAggregation always have an aggregation'
);
return $this->
hydrateResult($aggregationStruct,
$definition,
$rows,
$context);
case $aggregation instanceof AvgAggregation: