$query->
join( EntityDefinitionQueryHelper::
escape($table),
'(' .
$scoreQuery->
getSQL() . ')',
'score_table',
$join );
} foreach ($aggregation->
getFields() as $fieldName) { $this->queryHelper->
resolveAccessor($fieldName,
$definition,
$table,
$query,
$context,
$aggregation);
} $query->
resetQueryPart('groupBy'
);
$this->
extendQuery($aggregation,
$query,
$definition,
$context);
$rows =
$query->
executeQuery()->
fetchAllAssociative();
return $this->
hydrateResult($aggregation,
$definition,
$rows,
$context);
}